AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, Serializable

public class RailwayNetwork
extends AbstractDrawableMarkupAggregator
implements LevelMarkup, AggregatableAnimationElement
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
RailwayNetwork(Agent owner, String name, ShapeDrawMode drawMode, double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
RailwayNetwork(Agent owner, String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
RailwayNetwork(Agent owner, String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible, AbstractRailwayMarkup... contents)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
voidadd(PositionOnTrack pointOnTrack)
Adds a PositionOnTrack object to the network.
voidadd(RailwaySwitch sw)
Adds a RailwaySwitch object to the network.
voidadd(RailwayTrack track)
Adds a RailwayTrack object to the network.
voidaddAll(AbstractRailwayMarkup... contents)
Adds all arguments to the network
Stream<? extends AbstractMarkup>elementsInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
ShapeDrawModegetDrawMode()
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
LevelgetLevel()
Returns level associated with this space markup element or null if this element has no level
List<PositionOnTrack>getPointOnTracks()
Returns the list of all PositionOnTrack elements in this network.
AgentgetSpace() 
List<RailwaySwitch>getSwitches()
Returns the list of all switches in this network.
List<RailwayTrack>getTracks()
Returns the list of all tracks in this network.
doublegetZ()
Returns the base level z coordinate
doublemetersToPixels(double value)
Converts specified value from meters to pixels in the space of this network
doublepixelsToMeters(double value)
Converts specified value from pixels to meters in the space of this network
voidsetLevel(Level level) 
voidsetZ(double z)
Sets the base level z coordinate.

Methods inherited from class com.anylogic.engine.markup.AbstractDrawableMarkupAggregator

setDrawMode

Methods inherited from class com.anylogic.engine.markup.AbstractMarkupAggregator

error, getName, getOwner, initializeInternal, isVisible, onAggregatorVisibilityChanged, setVisible

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Constructor Details

RailwayNetwork

@Deprecated
public RailwayNetwork(Agent owner,
 String name,
 ShapeDrawMode drawMode,
 double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
Parameters:
owner -
name -
drawMode -
z -

RailwayNetwork

@Deprecated
public RailwayNetwork(Agent owner,
 String name,
 ShapeDrawMode drawMode,
 double z,
 boolean isPublic,
 boolean visible)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
Parameters:
owner -
name -
drawMode -
z -
isPublic -
visible -

RailwayNetwork

@AnyLogicInternalAPI
@Deprecated
public RailwayNetwork(Agent owner,
 String name,
 ShapeDrawMode drawMode,
 double z,
 boolean isPublic,
 boolean visible,
 AbstractRailwayMarkup... contents)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
Parameters:
owner -
name -
drawMode -
z -
isPublic -
visible -
contents -

Method Details

addAll

public void addAll(AbstractRailwayMarkup... contents)
Adds all arguments to the network
Parameters:
contents - - an instance of any of the following classes: RailwayTrack, RailwaySwitch, PositionOnTrack}

getSpace

public Agent getSpace()

setZ

public void setZ(double z)
Sets the base level z coordinate. Elements in network have z-coordinates related to this level.
Parameters:
z - the base level z coordinate

getZ

public double getZ()
Returns the base level z coordinate
Returns:
the base level z coordinate

getTracks

public List<RailwayTrack> getTracks()
Returns the list of all tracks in this network. The network should be initialized
Returns:
the list of all tracks in this network

getSwitches

public List<RailwaySwitch> getSwitches()
Returns the list of all switches in this network. The network should be initialized
Returns:
the list of all switches in this network

getPointOnTracks

public List<PositionOnTrack> getPointOnTracks()
Returns the list of all PositionOnTrack elements in this network. The network should be initialized
Returns:
the list of all PositionOnTrack elements in this network

elementsInternal

@AnyLogicInternalAPI
public Stream<? extends AbstractMarkup> elementsInternal()
Description copied from class: AbstractMarkupAggregator
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
elementsInternal in class AbstractMarkupAggregator<Agent>

add

public void add(RailwayTrack track)
Adds a RailwayTrack object to the network. The network should be uninitialized
Parameters:
track - RailwayTrack element to be added

add

public void add(RailwaySwitch sw)
Adds a RailwaySwitch object to the network. The network should be uninitialized
Parameters:
sw - RailwaySwitch element to be added

add

public void add(PositionOnTrack pointOnTrack)
Adds a PositionOnTrack object to the network. The network should be uninitialized
Parameters:
pointOnTrack - PositionOnTrack element to be added

pixelsToMeters

public double pixelsToMeters(double value)
Converts specified value from pixels to meters in the space of this network
Parameters:
value - in pixels

metersToPixels

public double metersToPixels(double value)
Converts specified value from meters to pixels in the space of this network
Parameters:
value - in meters

getLevel

public Level getLevel()
Description copied from interface: HasLevel
Returns level associated with this space markup element or null if this element has no level
Specified by:
getLevel in interface HasLevel
Returns:
the level associated with this space markup element

getDrawMode

public ShapeDrawMode getDrawMode()
Description copied from class: AbstractDrawableMarkupAggregator
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
Overrides:
getDrawMode in class AbstractDrawableMarkupAggregator

setLevel

@AnyLogicInternalAPI
public void setLevel(Level level)
Specified by:
setLevel in interface LevelElement