AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
java.io.Serializable

public class Level
extends AbstractDrawableMarkupAggregator
Level logically groups other animation elements like shapes, space markup elements, controls and charts. Levels operate with top-level elements, e.g. a shape inside a group knows about level from that group, and a path inside a network knows about level from that network.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
Level​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z)  
Level​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible)  
Level​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible, LevelMarkup... markupShapes)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
void add​(LevelElement shape)
Add shape to this level
void add​(LevelMarkup markup)
Add markup element to this level
void addAll​(LevelElement... elements)
Adds specified elements to the level.
java.util.stream.Stream<? extends AggregatableAnimationElement> elementsInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.util.List<AreaNode> getAreas()
Deprecated.
BoundingRectangle getBoundingRectangle()  
java.util.List<BulkConveyorBelt> getBulkConveyorBelts()
Returns a list of all conveyor belts on this level
java.lang.Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()  
java.util.List<ConveyorNetwork> getConveyorNetworks()
Returns a list of all conveyor networks on this level
java.util.List<Crane<?>> getCranes()
Returns a list of all cranes on this level
DensityMap getDensityMap()
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases.
DensityMap getDensityMap​(DensityMapType type)
Returns the density map of a particular type from this level
java.util.List<DensityMap> getDensityMaps()
Returns a list of all density maps on this level
java.util.List<EscalatorGroup> getEscalators()
Returns a list of all escalator groups on this level
java.util.List<LevelGate> getGates()
Returns a list of all gates on this level
java.util.List<Lift<?>> getLifts()
Returns a list of all lifts on this level
java.util.List<LevelMarkup> getMarkups()  
java.util.List<Network> getNetworks()
Returns a list of all networks on this level
java.util.List<Node> getNodes()
Returns a list of all nodes on this level
java.util.List<Obstacle> getObstacles()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.util.List<Pathway> getPathways()
Returns a list of all pathways on this level
java.util.List<PedFlowStatistics> getPedFlowStatistics()
Returns a list of all elements that collect pedestrian statistics on this level.
java.util.Collection<Agent> getPeds()
Return unmodifiable list of all the pedestrians in this level.
java.util.List<Pipe> getPipes()
Returns a list of all pipes on this level
java.util.List<RailwayNetwork> getRailwayNetworks()
Returns a list of all railway networks on this level
java.util.List<RoadNetwork> getRoadNetworks()
Returns a list of all road networks on this level
java.util.List<ServiceBase<?,​?>> getServices()
Returns a list of all services on this level
java.util.List<java.lang.Object> getShapes()
Returns the collection of shapes in the level.
Agent getSpace()
Returns the space where the markup element is defined
java.util.List<Storage> getStorages()
Returns a list of all storages on this level
java.util.List<StorageTank> getStorageTanks()
Returns a list of all storage tanks on this level
java.util.List<TargetLine> getTargetLines()
Returns a list of all target lines on this level
java.util.List<AbstractWall> getWalls()
Returns a list of all walls on this level
double getZ()
Returns the base level z coordinate.
double getZ​(double x, double y)
Returns the z coordinate of the given point
void initialize()
This method finalizes creation of level.
int pedestriansCount()
Returns number of pedestrians currently on this level.
void setDataSource​(LevelDataSource dataSource)  
void setDensityMap​(DensityMap densityMap)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases.
int size()
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases.
Modifier and Type Method Description

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

getDrawMode, 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

Constructor Detail

Level

public Level​(Agent owner,
             java.lang.String name,
             ShapeDrawMode drawMode,
             double z)

Level

public Level​(Agent owner,
             java.lang.String name,
             ShapeDrawMode drawMode,
             double z,
             boolean isPublic,
             boolean visible)

Level

public Level​(Agent owner,
             java.lang.String name,
             ShapeDrawMode drawMode,
             double z,
             boolean isPublic,
             boolean visible,
             LevelMarkup... markupShapes)

Method Detail

initialize

public void initialize()
This method finalizes creation of level. Should be called for levels created using short versions of constructors (without markup shapes) - after all the elements are added to the level. Invokes initialization for all the contained elements.

addAll

public void addAll​(LevelElement... elements)
Adds specified elements to the level. The level should be uninitialized.
Parameters:
elements - elements to be added. Pass an array of elements or specify them separated by commas

add

public void add​(LevelMarkup markup)
Add markup element to this level
Parameters:
markup - markup element

add

public void add​(LevelElement shape)
Add shape to this level
Parameters:
shape - shape element

setDensityMap

@Deprecated
public void setDensityMap​(DensityMap densityMap)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases. Please use add(LevelMarkup markup) instead
Parameters:
densityMap - the density map

getZ

public double getZ()
Returns the base level z coordinate. Areas in this level may modify the level
Returns:
the base level z coordinate
See Also:
getZ(double, double)

getZ

public double getZ​(double x,
                   double y)
Returns the z coordinate of the given point
Returns:
the z coordinate of the given point

getGates

public java.util.List<LevelGate> getGates()
Returns a list of all gates on this level

getNodes

public java.util.List<Node> getNodes()
Returns a list of all nodes on this level

getAreas

@Deprecated
public java.util.List<AreaNode> getAreas()
Deprecated.
NB: the returned list also contains areas from services
Returns:

getWalls

public java.util.List<AbstractWall> getWalls()
Returns a list of all walls on this level

getTargetLines

public java.util.List<TargetLine> getTargetLines()
Returns a list of all target lines on this level

getPedFlowStatistics

public java.util.List<PedFlowStatistics> getPedFlowStatistics()
Returns a list of all elements that collect pedestrian statistics on this level.

getDensityMap

@Deprecated
public DensityMap getDensityMap()
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases. Please use getDensityMaps() instead
Returns:
pedestrian density map

getDensityMaps

public java.util.List<DensityMap> getDensityMaps()
Returns a list of all density maps on this level

getDensityMap

public DensityMap getDensityMap​(DensityMapType type)
Returns the density map of a particular type from this level
Parameters:
type - the type of the density map: either pedestrian or transporter

getPathways

public java.util.List<Pathway> getPathways()
Returns a list of all pathways on this level

getServices

public java.util.List<ServiceBase<?,​?>> getServices()
Returns a list of all services on this level

getEscalators

public java.util.List<EscalatorGroup> getEscalators()
Returns a list of all escalator groups on this level

getLifts

public java.util.List<Lift<?>> getLifts()
Returns a list of all lifts on this level

getCranes

public java.util.List<Crane<?>> getCranes()
Returns a list of all cranes on this level

getStorages

public java.util.List<Storage> getStorages()
Returns a list of all storages on this level

getBulkConveyorBelts

public java.util.List<BulkConveyorBelt> getBulkConveyorBelts()
Returns a list of all conveyor belts on this level

getPipes

public java.util.List<Pipe> getPipes()
Returns a list of all pipes on this level

getStorageTanks

public java.util.List<StorageTank> getStorageTanks()
Returns a list of all storage tanks on this level

getNetworks

public java.util.List<Network> getNetworks()
Returns a list of all networks on this level

getConveyorNetworks

public java.util.List<ConveyorNetwork> getConveyorNetworks()
Returns a list of all conveyor networks on this level

getRailwayNetworks

public java.util.List<RailwayNetwork> getRailwayNetworks()
Returns a list of all railway networks on this level

getRoadNetworks

public java.util.List<RoadNetwork> getRoadNetworks()
Returns a list of all road networks on this level

getShapes

public java.util.List<java.lang.Object> getShapes()
Returns the collection of shapes in the level. The collection can contain either members of class Shape for shapes, and of class ReplicatedShape for replicated shapes. It may also contain 3D lights and cameras.
Returns:
the collection of shapes in the level

getObstacles

@AnyLogicInternalAPI
public java.util.List<Obstacle> getObstacles()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

elementsInternal

@AnyLogicInternalAPI
public java.util.stream.Stream<? extends AggregatableAnimationElement> 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>

getSpace

public Agent getSpace()
Returns the space where the markup element is defined
Returns:
the space associated with this element

setDataSource

@AnyLogicInternalAPI
public void setDataSource​(LevelDataSource dataSource)

getPeds

public java.util.Collection<Agent> getPeds()
Return unmodifiable list of all the pedestrians in this level.
Returns:
list of all the pedestrians in this level

size

@Deprecated
public int size()
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases. Please use pedestriansCount() instead Returns number of pedestrians currently on this level.
Returns:
number of pedestrians currently on this level.

pedestriansCount

public int pedestriansCount()
Returns number of pedestrians currently on this level.
Returns:
number of pedestrians currently on this level.

getCompatibleAgentExtensionClass

@AnyLogicInternalAPI
public final java.lang.Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

getMarkups

@AnyLogicInternalAPI
public java.util.List<LevelMarkup> getMarkups()
How can we improve this article?