After a simulation run is configured either in the stopped state or the idle state, running the simulation begins here.
Each train is assigned two initial paths:
- A short CW path including the 4 blocks of track in the parking lot and the 2 blocks of track at the left end of the large figure-eight.
- A large CW figure-eight path.
All trains are cycled through and moved forward if it can within the rules. A train may move forward within the current block or move to the next block in its currently assigned path.
Moving within the current block.
Each control block of track has 5 locations representing moving along the block of track. The train can be located at either end of the block, on one of the two IR sensors represented by the black dots on the track, or between the two IR sensors. The exceptions to this are the 4 short "parking places" which have only 1 IR sensor, the only place a train can be located.
A train enters a control block at one end, moved to the first IR sensor, then between the two IR sensors, to the second IR sensor. Sense the end of the current block is the same location at the beginning of the next block the rules for changing blocks are checked (below) and if the rules are met the train moves to the beginning of the next block. Within the parking lot trains move from the IR sensor in the current block to the IR sensor in the next block if the block is not occupied.
Moving to the next block.
There are only two rules controlling whether a train can move forward to the next block in its current path.
- A train can move to the next block if:
- Any turnouts or the crossover between the current block and the next block are not being used by another train and
- The next block is not occupied
- If the train is entering the two curved blocks of track at the left or right end of the display or entering the "X" in the middle of the display a train can move to the next block if:
- Rule #1 is met and
- The second block must not be occupied or
- If the second block is occupied the train must be going in the same direction as the train entering the first block.
If a train can move the current block of track is turned on and displayed in green. If the train is moving to a new block, logically we don't know where the train is between the last IR sensor on the current block and the first IR sensor on the next block. So both the current and next block are turned on and displayed in green. If the train is blocked this is indicated by displaying the current block in red.
Change to next path.
- The train is cleared to move to the next block and
- The next two blocks in the current path matches, in order, two blocks in the next path.
For example, in the "Starting" state each train starts with two paths assigned, see above. As a train is ready to exit the parking lot the next two blocks in its path match two blocks in the large CW figure-eight, so its current path is switched to the large CW figure-eight.
Add a next path
At this same time a check is made if another next path needs to be assigned. In the starting state, if a train was initially assigned either a small figure-eight or a small oval, as soon as the train is out of the parking lot, a small CW figure-eight path is assigned as the next path.
When all configured trains are out of the parking lot, the state is advanced to the Transition state (3).