TOC - prev - next - javadoc tree

2.7. Junction and Terminus concepts

A Junction is the endpoint of a Segment, a place at which a Strategy can choose which way to go.

A Junction has:

A Junction is represented by the Junction class.

A Strategy can obtain a reference to a Junction from the Board, or from a Segment object. All of the above data are visible.

Name and Index

The name of a Junction is specified in the Board's text file. They are unique.

The index is a unique non-negative integer; Junctions are indexed sequentially from zero.

Popularity and Terminus

If a Junction has a non-zero popularity, it is a Terminus, and can be chosen as a Destination. The probability that a Terminus be picked (as one of the two chosen) is proportional to its popularity. (Except that one's Destination is never the same as one's Origin.) The total popularity is revealed by the Board.

Names of non-Termini Junctions begin with an underscore; Termini names don't.


TOC - prev - next - javadoc tree