Giter VIP home page Giter VIP logo

acs's Introduction

Program ACS simulates an airline check-in system.

To use ACS:
Step 1: execute "make" in terminal to compile ACS
Step 2: execute "./ACS <input file>" in terminal to run ACS

To build your own input txt file:
The first line contains the total number of customers that will be simulated.
For every customer:
1.  The first character specifies the unique ID of customers.
2.  A colon immediately follows the unique number of the customer.
3.  Immediately following is an integer that indicates the arrival time of the customer.
4.  A comma immediately follows the previous number.
5.  Immediately following is an integer that indicates the service time of the customer.
6.  A newline ends a line.

A sample input file is included (in.txt).

acs's People

Contributors

shiyihuo avatar

Watchers

 avatar  avatar

acs's Issues

hidden bug: didn't handle empty input file

Current version has a workaround for empty input file but it may not work for other implementation. NCustomers is an memory address is input file is empty but usually memory address is much greater than curr_customer.

incorrect number of lines in input file will lead to unexpected behaviour

If the first number doesn't match number of lines in input file, ACS will read in more customers than expected.

input file:
25
1:20,60
4:7,30
5:7,40
7:10,30
2:4,70
3:5,5
15:2,2

Output:
number of customers: 25
1:20,60
4:7,30
5:7,40
7:10,30
2:4,70
3:5,5
15:2,2
15:2,2
15:2,2
......
15:2,2
15:2,2
........
customer 1's waiting time: 4.604218
customer 4's waiting time: 0.801271
customer 5's waiting time: 1.302752
customer 7's waiting time: 3.701974
customer 2's waiting time: 7.302233
customer 3's waiting time: 0.500808
customer 15's waiting time: 0.000015
customer 15's waiting time: 0.000043
.....
customer 15's waiting time: 0.200043
customer 15's waiting time: 6.203485

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.