Run Environment - JelleLa/ChiPy GitHub Wiki
A Run Environment describes the layout of stations.
runenv
method
The The runenv
method, also known as the Run Environment, is a method that defines the path an order takes in a simulation. Run environments are not predefined in ChiPy, but have to be manually written by the end-user. This is done to give the end-user complete freedom in chaining stations based on the simulation requirements.
def runenv(env, lot, stations):
yield env.process(stations["Station 1"].proc(lot = lot))
Since a run environment is written by the end-user, its arguments are also (mostly) free to choose. Parsing the environment and a lot going through the production line is mandatory. Stations can be directly initiated within the run environment, but it is common practise in ChiPy to initiate them outside of the run environment, for example in a dictionary.
Remarks
- A Run Environment does not necessarily has to be named
runenv
to work, since you parse it as an argument to achipy.generator
. Using a more descriptive name is thus an option, if desired. - Since a Run Environment is defined by the user, it can essentially do anything Python can do! It can, for example contain the calculation of a lot-specific process time for a station.
- The Run Environment can, if desired, be written in a separate
.py
file and be imported inside the main simulation script.