During a simulation run, the loading rack can be controlled through a set of API methods that provide access to active trains, planned operations, product volumes, passportization, and loading flow rates. These methods allow the model to adjust loading operations dynamically rather than relying only on a predefined schedule.
Train and Schedule Control The loading rack API provides methods for monitoring and controlling train processing:
getActiveTrain() — returns the train currently being processed by the loading rack, including loading, passportization, or shipment operations.
getPlannedTrains() — returns trains that are scheduled but have not yet been processed.
forcePassportization() — forces the currently active train into the passportization stage, regardless of its current loading progress.
These methods can be used to build
custom loading priority, loading rack scheduling, and operational control logic directly into the refinery simulation.
Loading Flow Control The loading rate of an individual loading rack element can be controlled during the simulation:
setInputSpeedLimitByItem() — sets the maximum input flow rate for a loading rack element in tons per hour.
getInputSpeedLimitByItem() — returns the current flow rate limit.
resetInputSpeedLimitByItem() — restores the flow limit to the system maximum defined by MAX_NODE_SPEED.
This allows the simulation to reproduce changing operating conditions, such as reduced loading rack capacity, temporary loading flow restrictions, or
different loading strategies.
Product Volume Monitoring getFillLevel(productId) returns the total fill level for a specified product in tons. The value combines the initially injected amount with the current volume stored in the wagon tanks.
This provides a direct way to monitor product loading volumes during the simulation and use product availability as an input to loading decisions. Together, these methods provide the basic controls required for dynamic loading rack management: monitoring the current operation, controlling the loading sequence, adjusting flow rates, and tracking product volumes while the simulation is running.