@@ -7,48 +7,48 @@ First, set up a parameters file as described in :ref:`parameters-file`.
77Now importing Ciw and the parameters file as a dictionary is simple::
88
99 >>> import ciw
10- >>> params = ciw.load_parameters(<path_to_file>)
11- >>> params["Number_of_servers"]
12- [2, 1, 1]
10+ >>> params = ciw.load_parameters(<path_to_file>) # doctest:+SKIP
11+ >>> params["Number_of_servers"] # doctest:+SKIP
12+ [2, 1, 1] # doctest:+SKIP
1313
1414Set up a Simulation object, from which all parameters can also be accessed::
1515
16- >>> Q = ciw.Simulation(params)
17- >>> Q.number_of_nodes
18- 3
19- >>> Q.queue_capacities
20- ['Inf', 'Inf', 10]
21- >>> Q.lmbda # The arrival rates of the system
22- [[1.0, 1.8, 7.25], [6.0, 4.5, 2.0]]
23- >>> Q.lmbda[0] # Arrival rates of the 0th class
24- [1.0, 1.8, 7.2]
16+ >>> Q = ciw.Simulation(params) # doctest:+SKIP
17+ >>> Q.number_of_nodes # doctest:+SKIP
18+ 3 # doctest:+SKIP
19+ >>> Q.queue_capacities # doctest:+SKIP
20+ ['Inf', 'Inf', 10] # doctest:+SKIP
21+ >>> Q.lmbda # The arrival rates of the system # doctest:+SKIP
22+ [[1.0, 1.8, 7.25], [6.0, 4.5, 2.0]] # doctest:+SKIP
23+ >>> Q.lmbda[0] # Arrival rates of the 0th class # doctest:+SKIP
24+ [1.0, 1.8, 7.2] # doctest:+SKIP
2525
2626A full list of Ciw's objects and attributes can be found here: :ref: `objects-attributes `
2727Now to run a simulation simply run the following method::
2828
29- >>> Q.simulate_until_max_time()
29+ >>> Q.simulate_until_max_time() # doctest:+SKIP
3030
3131Individuals' data records can be accessed directly using the following methods::
3232
33- >>> all_individuals = Q.get_all_individuals() # Creates a list of all individuals in the system
34- >>> all_individuals[0]
35- Individual 13
36- >>> all_individuals[0].data_records.values()[0][0].wait # Time Individual 13 was waiting for this instance of service
37- 0.39586652218275364
38- >>> all_individuals[0].data_records.values()[0][0].arrival_date # Time Individual 13 arrived for this instance of service
39- 0.5736475797750542
33+ >>> all_individuals = Q.get_all_individuals() # Creates a list of all individuals in the system # doctest:+SKIP
34+ >>> all_individuals[0] # doctest:+SKIP
35+ Individual 13 # doctest:+SKIP
36+ >>> all_individuals[0].data_records.values()[0][0].wait # Time Individual 13 was waiting for this instance of service # doctest:+SKIP
37+ 0.39586652218275364 # doctest:+SKIP
38+ >>> all_individuals[0].data_records.values()[0][0].arrival_date # Time Individual 13 arrived for this instance of service # doctest:+SKIP
39+ 0.5736475797750542 # doctest:+SKIP
4040
4141A full list of data records can be obtained, with or without headers::
4242
43- >>> records = Q.get_all_records(headers=True)
44- >>> records[:3]
45- [['I.D. Number', 'Customer Class', 'Node', 'Arrival Date', 'Waiting Time', 'Service Start Date', 'Service Time', 'Service End Date', 'Time Blocked', 'Exit Date'],
46- [1, 0, 1, 0.16207509531905792, 0.0, 0.16207509531905792, 0.014861757967438763, 0.1769368532864967, 0.0, 0.1769368532864967],
47- [2, 0, 1, 0.4628182409609607, 0.0, 0.4628182409609607, 0.13420139243827206, 0.5970196333992328, 0.0, 0.5970196333992328]]
43+ >>> records = Q.get_all_records(headers=True) # doctest:+SKIP
44+ >>> records[:3] # doctest:+SKIP
45+ [['I.D. Number', 'Customer Class', 'Node', 'Arrival Date', 'Waiting Time', 'Service Start Date', 'Service Time', 'Service End Date', 'Time Blocked', 'Exit Date'], # doctest:+SKIP
46+ [1, 0, 1, 0.16207509531905792, 0.0, 0.16207509531905792, 0.014861757967438763, 0.1769368532864967, 0.0, 0.1769368532864967], # doctest:+SKIP
47+ [2, 0, 1, 0.4628182409609607, 0.0, 0.4628182409609607, 0.13420139243827206, 0.5970196333992328, 0.0, 0.5970196333992328]] # doctest:+SKIP
4848
4949
5050The full list data records can be written to a csv file::
5151
52- >>> Q.write_records_to_file(<path_to_file>)
52+ >>> Q.write_records_to_file(<path_to_file>) # doctest:+SKIP
5353
5454Please see :ref: `output-file ` for an explanation of the data contained here.
0 commit comments