Stations - JelleLa/ChiPy GitHub Wiki
Stations are resources that serve orders.
The station class
A chipy.Station
is a class that represents a workstation including its buffer. A workstation can be used to model any kind of process, like a car wash washing cars, a machine assembling parts or a doctor treating a patient.
cp.Station(env = env, te = lambda: 1, cap = 1, queuesize = inf, queuepol = "FIFO", mf = 10, mr = 1, repairman = repairman, batchsize = 1 batchpol = "hard", data_collection = True)
A stations main property is its process time te
, defined as a lambda function. The process time defines how long a process should take which can be, due to the fact it is a lambda function, any desired value. It can be a constant (deterministic), but also the output of any function sample, like an exponential distribution.
Aside of the mandatory arguments, a station has multiple other properties which can be modified. A station's capacity (cap, default 1
) determines the amount of parallel processes a station can handle, like two parallel machines in a workstation, or a car wash which has place for multiple cars. Buffers have a fixed buffer capacity (queuesize
, default float("inf")
) and handles waiting orders according to a FIFO or LIFO policy (queuepol
, default "FIFO"
). Station breakdowns can be controlled with the time to failure mf
(default float("inf")
) and time for repair (mr
, default = float("inf")
) values. These times cycle continuously.
This fail behavior can be extended with a repairman
(default None
), which is given the task to repair the machine in mr
time. When a repairman is already busy at the point of request, the current repair request has to wait (according to a FIFO or LIFO policy) until the repairman has time to process the request.
Instead of processing per lot, a station can also process lots in batches of size batchsize
(defaults to 1, no batching). A batch size can either be a hard
condition (no smaller batches allowed) or a soft
condition (smaller batches also allowed). The latter condition is often used in furnaces. The furnace is filled with all orders waiting in the queue, with a maximum value. Condition types are parsed through the batchpol
argument.
Finally, data collection of a station can be turned on/off with the boolean data_collection
, which defaults to True
.
Calling a station
Placing a request is done using a station's proc
method, that takes care of requesting a station to process the lot, as well as processing the lot itself.
yield env.process(station.proc(lot = lot, us = station2, te = lambda: te))
Only the lot
argument is mandatory, since it needs something to process. Optional arguments are the us
argument to parse the chipy.Station
object of the upcoming station to avoid queue overflow in the case of finite buffers (Default NaN
) , and the lot specific process time te
if desired (Default None
).
Storing stations
Stations in ChiPy should always be stored in a dictionary, even if you have only one, since post processing methods rely on a station dictionary.
stations = {"Station 1": cp.Station(env = env, te = lambda: 7),
"Station 2": cp.Station(env = env, te = lambda: 2, queuepol = "LIFO", mf = 453, mr = 45)}
It is also a very convenient way to give stations descriptive names, like "wafer stepper 7", as well as a great method to organize them.