AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
IRouteProvider<ShortestPathData<Node,​Path>>, AggregatableAnimationElement, HasLevel, INetwork<Node,​Path>, LevelElement, LevelMarkup, java.io.Serializable

public class Network
extends AbstractNetwork<Node,​Path,​Agent>
implements LevelMarkup, AggregatableAnimationElement
Implementation of network for agent movement in continuous space.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
Network​(Agent owner, java.lang.String name)
Creates a network with a specified owner and name
Network​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases.
Network​(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.
Network​(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible, NetworkMarkupElement... markupShapes)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases.
Constructor Description

Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
void add​(PalletRack palletRack)
Adds a pallet rack to the network.
void addAll​(NetworkMarkupElement... markupShapes)
Adds all arguments to the network
static NetworkPort createPort​(Agent owner, Path path, PathEndType type)
Deprecated.
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.
BoundingRectangle getBoundingRectangle()  
java.lang.Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
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 (either 2D, 3D, or 2D&3D).
If the shape has been created with a no-argument constructor, has no specific limitations on the drawing mode (e.g., 2D only), and its drawing mode hasn't been set yet, then it is initialized to the default 2D&3D drawing mode.
Level getLevel()
Returns the level where this network is located.
java.util.List<PalletRack> getPalletRacks()
Returns List of all PalletRack in the network.
double getPlainDistance​(Point firstPoint, Point secondPoint)
Agent getSpace()
Returns the space where the space markup element is defined
double getZ()
Returns the z-coordinate of the base level.
void setDrawMode​(ShapeDrawMode drawMode)
Sets the drawing mode of the shape (either 2D, 3D, or 2D&3D).
This method may be called only once and only for the shapes which are created using a no-argument constructor (since they have no limitations on the drawing mode, e.g. 3D only).
void setLevel​(Level level)
Sets the new level where this network will be located.
void setZ​(double z)
Sets the z-coordinate of the base level.
Modifier and Type Method Description

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

add, add, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getLength, getNearestNetworkElement, getNearestNetworkElement, getNearestNetworkElement, getNearestNode, getNearestNode, getNearestNode, getNearestNode, getNearestPath, getNearestPath, getNearestPath, getNode, getNodeCount, getPath, getPathCount, getPathData, getPlainDistance, getPosition, getPosition, getPositionAtOffset, getRelatedNetworks, nodes, paths, ports

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

Network

public Network​(Agent owner,
               java.lang.String name)
Creates a network with a specified owner and name
Parameters:
owner - - the agent to whom this new instance belongs
name - - the name of the network

Network

@Deprecated
public Network​(Agent owner,
               java.lang.String name,
               ShapeDrawMode drawMode,
               double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases. Use Network(Agent, String)

Network

@Deprecated
public Network​(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. Use Network(Agent, String)

Network

@Deprecated
public Network​(Agent owner,
               java.lang.String name,
               ShapeDrawMode drawMode,
               double z,
               boolean isPublic,
               boolean visible,
               NetworkMarkupElement... markupShapes)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases. Use Network(Agent, String)

Method Detail

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>

addAll

public void addAll​(NetworkMarkupElement... markupShapes)
Adds all arguments to the network
Parameters:
markupShapes - - an instance of any of the following classes: Node, Path, PalletRack

setDrawMode

public void setDrawMode​(ShapeDrawMode drawMode)
Sets the drawing mode of the shape (either 2D, 3D, or 2D&3D).
This method may be called only once and only for the shapes which are created using a no-argument constructor (since they have no limitations on the drawing mode, e.g. 3D only). Any subsequent call for a shape that has the drawing mode already set, will throw an error.
Parameters:
drawMode - where to draw this shape: 2D, 3D, or 2D&3D

getDrawMode

public ShapeDrawMode getDrawMode()
Returns the drawing mode of the shape (either 2D, 3D, or 2D&3D).
If the shape has been created with a no-argument constructor, has no specific limitations on the drawing mode (e.g., 2D only), and its drawing mode hasn't been set yet, then it is initialized to the default 2D&3D drawing mode.

setZ

public void setZ​(double z)
Sets the z-coordinate of the base level. The elements in the network will have their z-coordinates calculated as relative to this level.
Parameters:
z - the z-coordinate of the base level

getZ

public double getZ()
Returns the z-coordinate of the base level. The elements in the network will have their z-coordinates calculated as relative to this level.
Returns:
the z-coordinate of the base level

add

public void add​(PalletRack palletRack)
Adds a pallet rack to the network.
Parameters:
palletRack - - a pallet rack to be added to the network

getPalletRacks

public java.util.List<PalletRack> getPalletRacks()
Returns List of all PalletRack in the network.
Returns:
a list of all pallet racks located in this network

getSpace

public Agent getSpace()
Returns the space where the space markup element is defined
Specified by:
getSpace in interface INetwork<Node,​Path>
Returns:
the space associated with this element

getLevel

public Level getLevel()
Returns the level where this network is located.
Specified by:
getLevel in interface HasLevel
Returns:
network level

setLevel

public void setLevel​(Level level)
Sets the new level where this network will be located.
Specified by:
setLevel in interface LevelElement
Parameters:
level - - the new level

getPlainDistance

public double getPlainDistance​(Point firstPoint,
                               Point secondPoint)
Specified by:
getPlainDistance in interface INetwork<Node,​Path>
Specified by:
getPlainDistance in class AbstractNetwork<Node,​Path,​Agent>
Returns:
distance between two points

getCompatibleAgentExtensionClass

@AnyLogicInternalAPI
public final java.lang.Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
Description copied from interface: INetwork
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
getCompatibleAgentExtensionClass in interface INetwork<Node,​Path>

createPort

@Deprecated
public static NetworkPort createPort​(Agent owner,
                                     Path path,
                                     PathEndType type)
Deprecated.
Creates NetworkPort on the specified path. Note, that this network port should be paired with another one for correct behavior. See MarkupPort.setPairedPort(MarkupPort)
Parameters:
owner - - the created network port will belong to this agent
path - - the created network port will be connected to this path
type - - determines the location of the specified path's ending point
Returns:
a new network port connected to the specified path

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()
How can we improve this article?