Skip to content

Commit 70483f1

Browse files
committed
docs on simulate_until_max_customers
1 parent dbafb48 commit 70483f1

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

ciw/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def simulate_until_max_customers(self, max_customers,
284284
Simulates until max_customers has reached the Exit Node
285285
- Method: Arrive
286286
Simulates until max_customers have spawned at the Arrival Node
287-
- Method Accept
287+
- Method: Accept
288288
Simulates until max_customers have been spawned and accepted
289289
(not rejected) at the Arrival Node
290290
"""

docs/Features/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Contents:
99
.. toctree::
1010
:maxdepth: 2
1111

12+
simulating.rst
1213
seed.rst
1314
progress_bar.rst
1415
distributions.rst

docs/Features/simulating.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
.. _simulation-methods:
2+
3+
=====================
4+
Methods of Simulating
5+
=====================
6+
7+
There are a number of ways to terminate a simulation:
8+
9+
- :ref:`until_maxtime`
10+
- :ref:`until_maxcustomers`
11+
- :ref:`until_deadlock`
12+
13+
.. _until_maxtime:
14+
15+
-------------------------------
16+
:code:`simulate_until_max_time`
17+
-------------------------------
18+
19+
This method simulates the system from an empty system. The simulation terminates once a certain amount of simulation time has passed. The method takes in a :code:`max_simulation_time`::
20+
21+
params = {
22+
'Arrival_distributions': [['Exponential', 1.0]],
23+
'Service_distributions': [['Exponential', 0.5]],
24+
'Number_of_servers': [1],
25+
'Transition_matrices': [[0.0]],
26+
'Queue_capacities': [3]
27+
}
28+
N = ciw.create_network(params)
29+
Q = ciw.Simulation(N)
30+
31+
Q.simulate_until_max_time(100)
32+
33+
Keyword arguments:
34+
- :code:`max_simulation_time`: REQUIRED. Length of simulation time to run the simulation for.
35+
- :code:`progress_bar`: OPTIONAL. See :ref:`progress-bars`.
36+
37+
38+
39+
.. _until_maxcustomers:
40+
41+
------------------------------------
42+
:code:`simulate_until_max_customers`
43+
------------------------------------
44+
45+
This method simulates the system from an empty system. The simulation terminates once a certain amount of customers passed through. The method takes in a :code:`max_customers`::
46+
47+
params = {
48+
'Arrival_distributions': [['Exponential', 1.0]],
49+
'Service_distributions': [['Exponential', 0.5]],
50+
'Number_of_servers': [1],
51+
'Transition_matrices': [[0.0]],
52+
'Queue_capacities': [3]
53+
}
54+
N = ciw.create_network(params)
55+
Q = ciw.Simulation(N)
56+
57+
Q.simulate_until_maxcustomers(20, method='Finish')
58+
59+
There are three methods of simulating for a maximum number of customers, specified by the :code:`method` keyword argument:
60+
- Finish: Simulates until :code:`max_customers` has reached the Exit Node.
61+
- Arrive: Simulates until :code:`max_customers` have spawned at the Arrival Node.
62+
- Accept: Simulates until :code:`max_customers` have been spawned and accepted (not rejected) at the Arrival Node.
63+
64+
Keyword arguments:
65+
- :code:`max_customers`: REQUIRED. The maximum number of customers.
66+
- :code:`method`: OPTIONAL. The method which customers are counted. Default method is 'Finish'.
67+
- :code:`progress_bar`: OPTIONAL. See :ref:`progress-bars`.
68+
69+
70+
.. _until_deadlock:
71+
72+
-------------------------------
73+
:code:`simulate_until_deadlock`
74+
-------------------------------
75+
76+
Simulated until the system reaches deadlock. Please see: :ref:`deadlock-detection`.

0 commit comments

Comments
 (0)