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

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

Constructor Summary

Constructors 
RailwayNetwork​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
RailwayNetwork​(Agent owner, java.lang.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, java.lang.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
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void add​(PositionOnTrack pointOnTrack)
Adds a PositionOnTrack object to the network.
void add​(RailwaySwitch sw)
Adds a RailwaySwitch object to the network.
void add​(RailwayTrack track)
Adds a RailwayTrack object to the network.
void addAll​(AbstractRailwayMarkup... contents)
Adds all arguments to the network
java.util.stream.Stream<? extends AbstractMarkup> elementsInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
ShapeDrawMode getDrawMode()
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).
Level getLevel()
Returns level associated with this space markup element or null if this element has no level
java.util.List<PositionOnTrack> getPointOnTracks()
Returns the list of all PositionOnTrack elements in this network.
Agent getSpace()  
java.util.List<RailwaySwitch> getSwitches()
Returns the list of all switches in this network.
java.util.List<RailwayTrack> getTracks()
Returns the list of all tracks in this network.
double getZ()
Returns the base level z coordinate
double metersToPixels​(double value)
Converts specified value from meters to pixels in the space of this network
double pixelsToMeters​(double value)
Converts specified value from pixels to meters in the space of this network
void setLevel​(Level level)  
void setZ​(double z)
Sets the base level z coordinate.
Modifier and Type Method Description

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 Detail

RailwayNetwork

@Deprecated
public RailwayNetwork​(Agent owner,
                      java.lang.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,
                      java.lang.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,
                      java.lang.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 Detail

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 java.util.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 java.util.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 java.util.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 java.util.stream.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
How can we improve this article?