Inputs

Name

Type

Range

Description

Start

int

[ 0, 47 ]

Starting point

Destination

int

[ 0, 47 ]

Destination point

ForwardNext

int[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.

ReverseNext

int[48][5]

[ -1, 47 ]

Same behavior as ForwardNext, but in the secondary direction. If the secondary direction is not permitted all values are -1.

Reverse

bool

[ 0, 1 ]

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

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

SwitchToForward

Int[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

SwitchToReverse

Int[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

Name

Type

Range

Description

Path

int[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

Tags: