AnyLogic
Expand
Font size
All Implemented Interfaces:
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

ConstructorDescription
Level(Agent owner, String name, ShapeDrawMode drawMode, double z) 
Level(Agent owner, String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible) 
Level(Agent owner, String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible, LevelMarkup... markupShapes) 

Method Summary

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

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

Constructor Details

Level

public Level(Agent owner,
 String name,
 ShapeDrawMode drawMode,
 double z)

Level

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

Level

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

Method Details

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

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 List<LevelGate> getGates()
Returns a list of all gates on this level

getNodes

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

getAreas

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

getWalls

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

getTargetLines

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

getPedFlowStatistics

public 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 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 List<Pathway> getPathways()
Returns a list of all pathways on this level

getServices

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

getEscalators

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

getLifts

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

getCranes

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

getStorages

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

getBulkConveyorBelts

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

getPipes

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

getStorageTanks

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

getNetworks

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

getConveyorNetworks

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

getRailwayNetworks

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

getRoadNetworks

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

getShapes

public List<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 List<Obstacle> getObstacles()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

elementsInternal

@AnyLogicInternalAPI
public 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 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 Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

getMarkups

@AnyLogicInternalAPI
public List<LevelMarkup> getMarkups()

toString

public String toString()
Overrides:
toString in class Object