Track Loop Delays

From Planimate Knowledge Base
Jump to: navigation, search

Track: Does Loop Delays Portal Option

When the leading edge of a train enters a crossing loop location, signal point or a branch location, some time will pass before the trailing edge of the train passes that same point.

During this time, the train is effectively occupying two sections, or points of capacity on the rail network.

If it is important to model this behaviour, then the Portal Option "Track:Does Loop Delays" can be set.

Selecting the portal option "Track: Does Loop Delays" enables Loop Entry and Exit delays for a portal. These delays are set by the references in the Track menu.
It works as follows:

How a Loop Entry Delay Works

When an item leaves a Track Object and enters the Portal, Planimate® will start a Loop Entry Delay on the road of the Track Object the item was using.

For a period of time equal to the "Loop Entry Delay" set in the Track Menu, Planimate® will treat as 'occupied' the road that was used by the item in that Track Object.

After the Loop Entry Delay is completed, the road is considered 'cleared' and becomes available to other train items.

However, the Loop Entry Delay is only applied when the train item has to stop, or spend time in the portal before leaving it again.

If the train immediately leaves the portal (within 0.1 seconds of its entry time) then the delay is cancelled.

Only if the train cannot leave the portal (e.g.: next track section prevents it) or it is held in the portal (e.g.: in a multiserver) then the inbound track road used by the item that entered the portal will be unavailable to other trains for the period of the Loop Entry Delay.

How a Loop Exit Delay Works

When the train item eventually tries to leave the portal, the following occurs:
While the Track Road that the train item wants to use is undergoing a Loop Entry Delay the train item is blocked from leaving.
Once the Loop Entry Delay finishes, access to the Track Road is granted to the Train Item, but before it is allowed to leave the Portal and take the Track Road a period of time called the Loop Exit Delay must pass.
Once the loop exit delay finishes, the train can leave the portal onto the outgoing section.

Loop Exit Delays are NOT applied to train items that proceed straight through the location unhindered. (i.e. that spend less than 0.1 seconds inside the subystem). This test is performed when the train checks whether it can depart the portal, if it has not been delayed, then no Portal Exit Delay is started.

Apart from being blocked from leaving, a train is free to move about inside the portal while the loop entry delay is under way.

Capacity Requirements

Portals with loop delays require a capacity for the train to wait at.

This can be a standard dispatcher or a multiserver configured for items to not block each other (the default). A queue is not recommended unless the trains must leave in a specific order.

If a train enters a loop delay portal and the item is subsequently destroyed (e.g.: in an exit) then any section with a loop entry delay is immediately released.

Loop Delays and moving items between Portals

Checks detect if a train is transferred from one track portal to another (eg: through a wormhole) and that train had a loop entry delay under way.

In this case it is important that the destination also have loop delays enabled so Planimate properly handles the loop delays on both ends.
If the option is not consistently set then Planimate will report an error.

Track Portals and the s.LoopExitDelayStart attribute

The "LoopExitDelayStart" system-item attribute only gets set where the portal is configured to use loop delays.
The s.LoopExitDelayStart time will properly represent the time the item started leaving the previous object for code in a loop-delay portal, the s.LoopExitDelayStart will only be valid up until the last point of capacity in the portal before the portal exit... so you can use it before a queue just before the portal exit but not after the queue (since the item would have "tested" the portal exit which needs to set this attribute as a loop exit delay could potentially be starting.