Inputs

NameTypeRangeDescription
Startint[ 0, 47 ]Starting point
Destinationint[ 0, 47 ]Destination point
ForwardNextint[48][5][ -1, 47 ]The next track in the main direction. Each track can have at most 5 possible next tracks. Invalid branches are represented by the value -1.
ReverseNextint[48][5][ -1, 47 ]Same behavior as ForwardNext, but in the secondary direction. If the secondary direction is not permitted all values are -1.
Reversebool[ 0, 1 ]

0 → the train is traveling in the track's main direction

1 → the train is traveling in the track's reverse direction

SwitchToForwardInt[2][ 0, 47 ],[ 0,4 ]

Identifies the track connection which places the train on the outer loop facing in the forward direction.

[ 0 ] → index of the inner loop track

[ 1 ] → index of the next track in the ForwardNext or ReverseNext array

SwitchToReverseInt[2][ 0, 47 ],[ 0,4 ]

Identifies the track connection which places the train on the outer loop facing in the reverse direction.

[ 0 ] → index of the inner loop track

[ 1 ] → index of the next track in the ForwardNext or ReverseNext array


Outputs

NameTypeRangeDescription
Pathint[200][ 0, 47 ]

Sequence of tracks to follow to get from the starting point to the destination (shortest path)

The end of the sequence is marked by the value -1