We provide some specific data access from the simulation context to allow you to enhance your simulation configuration.
SimulationContext.Time |
Represents the simulation time as System.DateTime (.NET type). Can be used as getter in all python scripts. You can use the following methods:
Example usage 1 as gateway condition: SimulationContext.Time.Hour>12 will check, whether current time is 13:00 or later. Example usage 2 as gateway condition: SimulationContext.Time.DayOfWeek=='Friday' will check, whether current day is Friday. At time-based events with scripted inter-arrival time, you can use operations like:
|
SimulationContext.Resources |
Provides access to the current state of resources. Can only be used as getter. You can use the following methods:
Example usage 1 as gateway condition: SimulationContext.Resources.IsIdle('executive officer') will check, whether at least one 'executive officer' is free. Example usage 2 as gateway condition: SimulationContext.Resources.CountIdle('executive officer')>=3 will check, whether at least three 'executive officer' are free. |
SimulationContext.Product |
Represents the current product as a string. Can be used as getter or setter. Example usage as gateway condition: SimulationContext.Product=='standard product' will check, whether the current product is called 'standard product'. Example usage as activity expression: SimulationContext.Product='standard product' will set the current product to 'standard product'. |