The rail yard topology is specified by specific space markup shapes designed for rail models: railway tracks, switches and elements defining offsets on the track (Position on track). These shapes can be either drawn manually using AnyLogic graphical editor or created programmatically by e.g. reading the layout from a database or a file.
Railway network is automatically created when you create a railway track. It can be extended by connecting more tracks together.
Please refer to Railway track for more information about drawing and connecting tracks.
To change railway network parameters
Name – The name of the railway network. The name is used to identify and access the network from code and flowchart blocks properties.
Ignore – If selected, the network is excluded from the model.
Visible on upper agent
– If selected, the network is also visible on the upper agent where this agent lives.
Lock – If selected, the network is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them.
Visible – Here you specify whether the network shapes are visible on animation at model runtime, or not. Using the control, choose yes or no.
Level – Level to which this railway network belongs.
Show in – Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.
List<RailwayTrack> getTracks() - Returns the list of tracks belonging to this railway network.
List<RailwaySwitch> getSwitches() - Returns the list of switches belonging to this railway network.
List<PositionOnTrack> getPointOnTracks() - Returns the list of Position on Track elements belonging to this railway network.
double getZ() - Returns the Z-coordinate of the railway network's base level.
boolean isVisible() - Returns true if the railway network is visible; returns false otherwise.
void setVisible(boolean v)
- Sets the visibility of the railway network.
Parameter: v - visibility. If v is true - the railway network is set to be visible, if it is false - not visible.
Position on track
API reference: RailwayNetwork class