To implement the mutable boundaries algorithm, the Conveyor resource uses an infrastructure based on Virtual Entities (VE) and passive storage areas (RESTROOM). All the logic takes place while the boxes are "asleep", waking up only to transition between states.
A. Main Flow Implementation:
RESTROOM {NAME:RR_InputBuffer ,X:348,Y:467,on_rest:RR_InputBuffer ,visible:0}
RESTROOM {NAME:RR_Conveyor ,X:581,Y:470,on_rest:RR_Conveyor ,visible:0}
GENERATE ...
REST RR_InputBuffer ; The box enters the funnel and sleeps until there is room
REST RR_Conveyor ; Once awakened, it enters the conveyor and goes back to sleep until it exits
TERMINATE 1
We use two RESTROOM-type resources that act as logical states and have an ON_REST hook that triggers procedures when an entity arrives.
B. Resource Variables
Conveyor physical properties:
- RR_Length: Total conveyor length.
- RR_Speed: Movement speed.
- RR_Gap: The space that RR_InputBuffer must leave between boxes.
- RR_decimals: Time decimal places.
Dynamic limits ("mutable boundaries")
- RR_StopLimit: The position of the "plug" or jam (initially at the end: -RR_Length).
- RR_EntryLimit: The proximity limit for new entries.
Entities relevant to the logic
- RR_EnteringEntity: Box in RR_InputBuffer attempting to enter.
- RR_LeavingEntity: Box in RR_Conveyor attempting to exit.
- RR_LastStopedEntity: Last box in RR_Conveyor that has been stopped.
Causal topology
- For the resource:
RR_EntityLeader: Box closest to the conveyor exit.
RR_EntityTail: Box closest to the conveyor entrance. - Each box maintains direct references to its immediate neighbors:
RR_PackFront: Box immediately ahead.
RR_PackRear: Box immediately behind.
C. TimeOut Temporal Orchestrators:
- RR_InputBuffer and RR_EntryTimeout: Evaluate whether entry is possible.
- RR_Conveyor and RR_ExitTimeout: Evaluate whether exit is possible.
- RR_StopTimeout and RR_ResumeTimeout: Evaluate jams and continuity.
D. Regime Versioning:
Deferred events may become obsolete after state changes such as a stop (Stop) or a resumption (Resume).
- RR_StopRegimeVersion
- RR_ExitRegimeVersion