AnyLogic AnyLogic
Expand
Font size

Class AreaNode<T extends Agent>

All Implemented Interfaces:
AggregatableAnimationElement, AnimationStaticLocationProvider, IAreaNodeDescriptor<T>, IDescriptor, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, INode<Node,​Path>, LevelElement, LevelMarkup, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>, SVGElement, java.io.Serializable, java.lang.Iterable<T>
Direct Known Subclasses:
PolygonalNode, RectangularNode

@AnyLogicInternalAPI
public abstract class AreaNode<T extends Agent>
extends Node
implements IAreaNodeDescriptor<T>, java.lang.Iterable<T>
See Also:
Serialized Form

Constructor Summary

Constructors 
AreaNode()  
AreaNode​(Agent owner)  
AreaNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, Slope slope, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, boolean speedRestriction, double maxSpeedInMPS, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
AreaNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> areaNodeDescriptor, double x, double y, double z, Slope slope, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)  
Constructor Description

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
boolean accessRestrictionCondition​(T agent)
Evaluates the area access condition for the specified agent
void addAgent​(T agent)  
void addAreaDataSource​(IAreaDataSource areaDataSource)  
void addAttractor​(Attractor attractor)
Sets the position choice mode to PositionChoiceMode.POSITION_CHOICE_BY_ATTRACTORS and adds the specified attractor to this area.
java.util.List<T> agents()
Returns the list of agents currently present in this area.
abstract double area​(AreaUnits units)
Returns the area of this area, measured in area units
void close()
Closes the area.
boolean contains​(Agent agent)
Returns true, if the area contains the specified agent, otherwise returns false.
double density​(AreaUnits units)
Returns the average value of density inside the area, measured in agents per area units.
AreaAccessRestrictionType getAccessRestrictionType()
Returns access restriction type.
java.util.List<Agent> getAdmittedTransporters()
Returns the list of transporters admitted to the area.
java.util.List<T> getAgentsWaitingToEnter()
Returns a list of agents waiting in the queue to enter the area.
java.util.List<Attractor> getAttractors()
Returns the list of this area attractors
int getCapacity()
Returns capacity for access restriction
java.awt.Color getFillColor()
Returns the fill color of the markup element, or null if markup element has no fill color or has textured fill (in this case getFillTexture() should be used instead)
Texture getFillTexture()
Returns the fill texture of the markup element, if the markup element has fill texture
java.awt.Color getLineColor()
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case getLineTexture() should be used instead)
LineStyle getLineStyle()
Returns the line style of the markup element: {LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
double getLineWidth()
Returns the line width of the markup element.
double getMaxSpeed​(SpeedUnits units)
Returns the maximum speed in the specified speed units
int getNumberOfAdmittedAgents()
Returns the number of agents admitted to the area.
int getNumberOfAdmittedTransporters()
Returns the number of transporters admitted to the area.
java.util.List<Agent> getPeds()
Returns the list of pedestrians currently present in this area.
Position getPosition​(int index, int totalNumber, Position out)
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
PositionChoiceMode getPositionChoiceMode()
Returns the position choice mode for this area.
java.lang.Class<? extends Agent> getRestrictedAgentClass()
Returns the restricted agent class
Schedule<java.lang.Boolean> getSchedule()
Returns the schedule of area access restriction
Slope getSlope()
Returns the slope for current area
double getThroughput​(RateUnits units)
Returns the maximum number of agents that can enter the area per rate unit.
double getX()
Returns the x coordinate of the markup element.
double getY()
Returns the y coordinate of the markup element.
double getZ()
Returns the z coordinate of the markup element, relative to level/network, if any is defined.
double getZ​(double x, double y)
Returns the z coordinate of the given point
boolean isAccessRestricted()
Returns true if the access to the area is restricted and false otherwise
boolean isAllowedToEnter​(T agent)  
boolean isApplied​(T agent)  
boolean isAvoidedIfClosed()
Returns the value of avoided if closed parameter
boolean isLimitSpeed()
Return true if speed is limited in this node, false otherwise
boolean isOpen()
Returns true if the area is open and false if the area is closed.
boolean isReadyToEnter​(T agent)  
boolean isSpeedRestricted()
Checks whether the area has speed restriction enabled.
java.util.Iterator<T> iterator()
Returns the iterator for all agents inside the area.
void notifyCancelReadyToEnter​(T agent)  
boolean notifyReadyToEnter​(T agent)  
void notifyReadyToEnter2​(T agent)  
void notifyReadyToExit​(T agent)  
void onClose()
Code executed when the area closes.
void onEnter​(T agent)
Code executed when the agent enters the area.
void onEnterDenied​(T agent)
Code that will be executed when the agent attempts to enter the node but is not allowed to.
void onExit​(T agent)
Code executed when the agent exits the area.
void onOpen()
Code executed when the area opens.
void open()
Opens the area.
void recalculateAccessibility()
The method recalculates the accessibility of the area node.
void removeAgent​(T agent)  
void removeAreaDataSource​(IAreaDataSource areaDataSource)  
void removeFromQueue​(T agent)  
void restrictAccessByCapacity​(int number)
Enables restriction of access to the node by capacity.
void restrictAccessBySchedule​(Schedule<java.lang.Boolean> schedule)
Enables restriction of access to the node by schedule.
void restrictAccessByThroughput​(double throughput, RateUnits units)
Enables restriction of access to the node by throughput.
void restrictAccessManually​(boolean initiallyClosed)
Enables restriction of access to the node manually.
void restrictSpeed​(double maxSpeed, SpeedUnits units)
Enables speed restriction for the node.
void setAccessRestricted​(boolean restricted)
Sets restriction of access.
void setAccessRestrictionType​(AreaAccessRestrictionType accessRestrictionType)
Sets access restriction type.
void setAvoidedIfClosed​(boolean avoided)
Sets the value of avoided if closed parameter
void setCapacity​(int number)
Sets capacity for access restriction
void setLimitSpeed​(boolean restriction)
Deprecated.
void setLineColor​(java.awt.Color lineColor)
Sets the line color of the markup element.
void setLineColor​(java.awt.Paint lineColor)
Sets the line color (or Texture) of the markup element.
void setLineStyle​(LineStyle lineStyle)
Sets the line style of the markup element: {LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
void setLineWidth​(double width)
Sets the line width of the markup element, 0 means thinnest possible
void setMaxSpeed​(double maxSpeed, SpeedUnits units)
Deprecated.
void setOpen​(boolean open)
Makes the area either open or closed to the incoming agents.
void setPos​(double x, double y, double z)
Sets coordinates of the markup element
void setPositionChoiceMode​(PositionChoiceMode positionChoiceMode)
Sets the position choice mode for this area.
void setRestrictedAgentClass​(java.lang.Class<? extends Agent> restrictedClass)
Sets the restricted agent class
void setSchedule​(Schedule<java.lang.Boolean> schedule)
Sets the schedule of area access restriction
void setSlope​(Slope slope)
Sets the slope for current area
void setSpeedRestricted​(boolean restriction)
Sets the speed restriction in the area.
void setThroughput​(double throughput, RateUnits units)
Sets the maximum number of agents that can enter the area per rate unit.
Modifier and Type Method Description

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

addConnection, getCompatibleAgentExtensionClass, getConnection, getConnectionsCount, getMaterialLibraryDescriptor, getNumberOfTransporters, getTransferDistance, getTransferPositionByPercent, getTransporter, getTransporters, setFillColor, setFillColor

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

getDrawMode, getLevel, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNetwork, setLevel

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

contains, error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

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

discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

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

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

getSpace

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

getLevel

Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor

getMarkup, setMarkup

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

contains, getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside, randomPointInside

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

getName

Methods inherited from interface java.lang.Iterable

forEach, spliterator

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

setLevel

Constructor Detail

AreaNode

public AreaNode()

AreaNode

public AreaNode​(Agent owner)

AreaNode

@AnyLogicInternalCodegenAPI
public AreaNode​(Agent owner,
                ShapeDrawMode drawMode,
                boolean isPublic,
                IAreaNodeDescriptor<T> areaNodeDescriptor,
                double x,
                double y,
                double z,
                Slope slope,
                java.awt.Paint fillColor,
                java.awt.Paint lineColor,
                double lineWidth,
                LineStyle lineStyle,
                PositionChoiceMode positionChoiceMode,
                PathEnd<Path>[] pathEnds,
                Attractor... attractors)

AreaNode

@Deprecated
public AreaNode​(Agent owner,
                ShapeDrawMode drawMode,
                boolean isPublic,
                double x,
                double y,
                double z,
                Slope slope,
                java.awt.Paint fillColor,
                java.awt.Paint lineColor,
                double lineWidth,
                LineStyle lineStyle,
                PositionChoiceMode positionChoiceMode,
                boolean speedRestriction,
                double maxSpeedInMPS,
                PathEnd<Path>[] pathEnds,
                Attractor... attractors)
Deprecated.

Method Detail

isReadyToEnter

@AnyLogicInternalAPI
public boolean isReadyToEnter​(T agent)

addAttractor

public void addAttractor​(Attractor attractor)
Sets the position choice mode to PositionChoiceMode.POSITION_CHOICE_BY_ATTRACTORS and adds the specified attractor to this area. Area should be uninitialized.
Parameters:
attractor - attractor to be added

area

public abstract double area​(AreaUnits units)
Returns the area of this area, measured in area units
Parameters:
units - the area units
Returns:
area of this area, measured in area units

agents

public java.util.List<T> agents()
Returns the list of agents currently present in this area.
Returns:
the list of agents currently present in this area.

getAgentsWaitingToEnter

public java.util.List<T> getAgentsWaitingToEnter()
Returns a list of agents waiting in the queue to enter the area.
Returns:
a list of agents waiting in the queue to enter the area.

getNumberOfAdmittedAgents

public int getNumberOfAdmittedAgents()
Returns the number of agents admitted to the area.
Returns:
the number of agents admitted to the area.

getNumberOfAdmittedTransporters

public int getNumberOfAdmittedTransporters()
Returns the number of transporters admitted to the area.
Returns:
the number of transporters admitted to the area.

iterator

public java.util.Iterator<T> iterator()
Returns the iterator for all agents inside the area.
Specified by:
iterator in interface java.lang.Iterable<T extends Agent>

density

public double density​(AreaUnits units)
Returns the average value of density inside the area, measured in agents per area units.
Parameters:
units - the area units
Returns:
average value of density inside the area, measured in agents per area units.

recalculateAccessibility

public void recalculateAccessibility()
The method recalculates the accessibility of the area node. Should be called if the area access is restricted by AREA_ACCESS_RESTRICTION_BY_CONDITION to notify transporters about changes in the area accessibility

contains

public boolean contains​(Agent agent)
Returns true, if the area contains the specified agent, otherwise returns false.
Parameters:
agent - the agent
Returns:
true, if the area contains the specified agent, otherwise returns false.

addAreaDataSource

@AnyLogicInternalAPI
public void addAreaDataSource​(IAreaDataSource areaDataSource)

removeAreaDataSource

@AnyLogicInternalAPI
public void removeAreaDataSource​(IAreaDataSource areaDataSource)

getPeds

@AnyLogicInternalAPI
public java.util.List<Agent> getPeds()
Returns the list of pedestrians currently present in this area.
Returns:
the list of pedestrians currently present in this area.

getAdmittedTransporters

public java.util.List<Agent> getAdmittedTransporters()
Returns the list of transporters admitted to the area.
Returns:
returns transporters admitted to the area..

onEnterDenied

public void onEnterDenied​(T agent)
Code that will be executed when the agent attempts to enter the node but is not allowed to.
Specified by:
onEnterDenied in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
agent - the agent

onEnter

public void onEnter​(T agent)
Code executed when the agent enters the area.
Specified by:
onEnter in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
agent - the agent

onExit

public void onExit​(T agent)
Code executed when the agent exits the area.
Specified by:
onExit in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
agent - the agent

onClose

public void onClose()
Code executed when the area closes.
Specified by:
onClose in interface IAreaNodeDescriptor<T extends Agent>

onOpen

public void onOpen()
Code executed when the area opens.
Specified by:
onOpen in interface IAreaNodeDescriptor<T extends Agent>

isAccessRestricted

public boolean isAccessRestricted()
Returns true if the access to the area is restricted and false otherwise
Specified by:
isAccessRestricted in interface IAreaNodeDescriptor<T extends Agent>
Returns:
true if the access to the area is restricted and false otherwise

setAccessRestricted

@AnyLogicInternalAPI
public void setAccessRestricted​(boolean restricted)
Sets restriction of access. May be called only before initialization
Specified by:
setAccessRestricted in interface IAreaNodeDescriptor<T extends Agent>

restrictAccessByCapacity

public void restrictAccessByCapacity​(int number)
Enables restriction of access to the node by capacity. Restriction type can not be changed after initialization. The method will disable previously enabled access restriction of another type (if any). The method can be called after initialization to modify capacity value.
Parameters:
number - allowed capacity

restrictAccessByThroughput

public void restrictAccessByThroughput​(double throughput,
                                       RateUnits units)
Enables restriction of access to the node by throughput. Restriction type can not be changed after initialization. The method will disable previously enabled access restriction of another type (if any). The method can be called after initialization to modify throughput value.
Parameters:
throughput - maximum number of agents per rate unit
units - throughput rate unit

restrictAccessBySchedule

public void restrictAccessBySchedule​(Schedule<java.lang.Boolean> schedule)
Enables restriction of access to the node by schedule. Restriction type can not be changed after initialization. The method will disable previously enabled access restriction of another type (if any). The method can be called after initialization to set another schedule.
Parameters:
schedule - an object of class Schedule. Intervals of true correspond to the time intervals during which the area is closed.

restrictAccessManually

public void restrictAccessManually​(boolean initiallyClosed)
Enables restriction of access to the node manually. Restriction type can not be changed after initialization. The method will disable previously enabled access restriction of another type (if any). To control availability of the area in runtime use open(), close() or setOpen(boolean)).
Parameters:
initiallyClosed - the initial state of area. Initially closed if true and initially open otherwise.

restrictSpeed

public void restrictSpeed​(double maxSpeed,
                          SpeedUnits units)
Enables speed restriction for the node. Speed restriction should be enabled before initialization. Speed restriction may be enabled additionally with access restriction. The method can be called after initialization to modify maximum speed.
Parameters:
maxSpeed - maximum allowed speed in the node
units - speed units

isOpen

public boolean isOpen()
Returns true if the area is open and false if the area is closed.
Returns:
true if the area is open and false if the area is closed.

setOpen

public void setOpen​(boolean open)
Makes the area either open or closed to the incoming agents.
Parameters:
open - setting parameter to true opens the area. Setting parameter to false closes the area

open

public void open()
Opens the area.

close

public void close()
Closes the area.

notifyReadyToEnter

@AnyLogicInternalLibraryAPI
public boolean notifyReadyToEnter​(T agent)

notifyReadyToEnter2

@AnyLogicInternalLibraryAPI
public void notifyReadyToEnter2​(T agent)

notifyCancelReadyToEnter

@AnyLogicInternalLibraryAPI
public void notifyCancelReadyToEnter​(T agent)

addAgent

@AnyLogicInternalLibraryAPI
public void addAgent​(T agent)

removeAgent

@AnyLogicInternalLibraryAPI
public void removeAgent​(T agent)

removeFromQueue

@AnyLogicInternalAPI
public void removeFromQueue​(T agent)

isAllowedToEnter

@AnyLogicInternalLibraryAPI
public boolean isAllowedToEnter​(T agent)

isApplied

@AnyLogicInternalLibraryAPI
public boolean isApplied​(T agent)

notifyReadyToExit

@AnyLogicInternalLibraryAPI
public void notifyReadyToExit​(T agent)

getX

public double getX()
Returns the x coordinate of the markup element.
Returns:
the x coordinate of the markup element

getY

public double getY()
Returns the y coordinate of the markup element.
Returns:
the y coordinate of the markup element

getZ

public double getZ()
Returns the z coordinate of the markup element, relative to level/network, if any is defined.
Specified by:
getZ in class Node
Returns:
the z coordinate of the markup element

getZ

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

getSlope

public Slope getSlope()
Returns the slope for current area
Returns:
the slope for current area

setSlope

public void setSlope​(Slope slope)
Sets the slope for current area
Parameters:
slope - - the slope for current area

setPos

public void setPos​(double x,
                   double y,
                   double z)
Sets coordinates of the markup element
Parameters:
x - the new value of x coordinate
y - the new value of y coordinate
z - the new value of z coordinate

setLineColor

public void setLineColor​(java.awt.Color lineColor)
Sets the line color of the markup element.
Specified by:
setLineColor in class Node
Parameters:
lineColor - the new line color, null = do not draw the markup element line

setLineColor

public void setLineColor​(java.awt.Paint lineColor)
Sets the line color (or Texture) of the markup element.
Specified by:
setLineColor in interface INode<Node,​Path>
Specified by:
setLineColor in class Node
Parameters:
lineColor - the new line color, null = do not draw the markup element line

getLineColor

public java.awt.Color getLineColor()
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case getLineTexture() should be used instead)
Specified by:
getLineColor in interface INode<Node,​Path>
Specified by:
getLineColor in class Node
Returns:
the line color of the markup element

getLineTexture

public Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
Specified by:
getLineTexture in interface INode<Node,​Path>
Specified by:
getLineTexture in class Node
Returns:
the line texture of the markup element

getFillColor

public java.awt.Color getFillColor()
Returns the fill color of the markup element, or null if markup element has no fill color or has textured fill (in this case getFillTexture() should be used instead)
Specified by:
getFillColor in interface INode<Node,​Path>
Overrides:
getFillColor in class Node
Returns:
the fill color of the markup element

getFillTexture

public Texture getFillTexture()
Returns the fill texture of the markup element, if the markup element has fill texture
Specified by:
getFillTexture in interface INode<Node,​Path>
Overrides:
getFillTexture in class Node
Returns:
the fill texture of the markup element

setLineWidth

public void setLineWidth​(double width)
Sets the line width of the markup element, 0 means thinnest possible
Parameters:
width - the new line width of the markup element

getLineWidth

public double getLineWidth()
Returns the line width of the markup element.
Returns:
the line width of the markup element

setLineStyle

public void setLineStyle​(LineStyle lineStyle)
Sets the line style of the markup element: {LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
Parameters:
lineStyle - the new style of the markup element

getLineStyle

public LineStyle getLineStyle()
Returns the line style of the markup element: {LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
Returns:
the line style of the markup element

getPosition

public Position getPosition​(int index,
                            int totalNumber,
                            Position out)
Description copied from interface: AnimationStaticLocationProvider
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Specified by:
getPosition in interface AnimationStaticLocationProvider
Parameters:
index - the index of some item positions, should be not negative and less than totalNumber
totalNumber - the total number of item positions, should be positive
out - output object to write to, may be null
Returns:
the Position object with coordinates of the requested item position

getAttractors

public java.util.List<Attractor> getAttractors()
Returns the list of this area attractors
Returns:
the attractors of this area

getPositionChoiceMode

public PositionChoiceMode getPositionChoiceMode()
Returns the position choice mode for this area. Area should be initialized
Returns:
position choice mode for this area, which can be:
  • POSITION_CHOICE_RANDOM
  • POSITION_CHOICE_ARRANGED
  • POSITION_CHOICE_BY_ATTRACTORS

setPositionChoiceMode

public void setPositionChoiceMode​(PositionChoiceMode positionChoiceMode)
Sets the position choice mode for this area. Area should be uninitialized.
Parameters:
positionChoiceMode - the position choice mode, which can be:
  • POSITION_CHOICE_RANDOM
  • POSITION_CHOICE_ARRANGED
  • POSITION_CHOICE_BY_ATTRACTORS

setLimitSpeed

@Deprecated
public void setLimitSpeed​(boolean restriction)
Deprecated.
Description copied from class: Node
Enables speed limit in this node if the argument is true, disables it if the argument is false The element should be uninitialized
Overrides:
setLimitSpeed in class Node
Parameters:
restriction - argument flag

isLimitSpeed

@AnyLogicInternalAPI
public boolean isLimitSpeed()
Description copied from class: Node
Return true if speed is limited in this node, false otherwise
Overrides:
isLimitSpeed in class Node

getAccessRestrictionType

public AreaAccessRestrictionType getAccessRestrictionType()
Returns access restriction type.
Specified by:
getAccessRestrictionType in interface IAreaNodeDescriptor<T extends Agent>
Returns:
access restriction type. Possible values are:
  • AREA_ACCESS_RESTRICTION_BY_CAPACITY
  • AREA_ACCESS_RESTRICTION_BY_THROUGHPUT
  • AREA_ACCESS_RESTRICTION_BY_SCHEDULE
  • AREA_ACCESS_RESTRICTION_BY_CONDITION
  • AREA_ACCESS_RESTRICTION_MANUAL

setAccessRestrictionType

@AnyLogicInternalAPI
public void setAccessRestrictionType​(AreaAccessRestrictionType accessRestrictionType)
Sets access restriction type. May be called only before initialization.
Specified by:
setAccessRestrictionType in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
accessRestrictionType - access restriction type possible values are:
  • AREA_ACCESS_RESTRICTION_BY_CAPACITY
  • AREA_ACCESS_RESTRICTION_BY_THROUGHPUT
  • AREA_ACCESS_RESTRICTION_BY_SCHEDULE
  • AREA_ACCESS_RESTRICTION_BY_CONDITION
  • AREA_ACCESS_RESTRICTION_MANUAL

getCapacity

public int getCapacity()
Returns capacity for access restriction
Specified by:
getCapacity in interface IAreaNodeDescriptor<T extends Agent>
Returns:
capacity for access restriction

setCapacity

@AnyLogicInternalAPI
public void setCapacity​(int number)
Sets capacity for access restriction
Specified by:
setCapacity in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
number - - allowed capacity

getThroughput

public double getThroughput​(RateUnits units)
Returns the maximum number of agents that can enter the area per rate unit.
Specified by:
getThroughput in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
units - the rate units
Returns:
maximum number of agents per rate unit

setThroughput

@AnyLogicInternalAPI
public void setThroughput​(double throughput,
                          RateUnits units)
Sets the maximum number of agents that can enter the area per rate unit.
Specified by:
setThroughput in interface IAreaNodeDescriptor<T extends Agent>
Parameters:
throughput - maximum number of agents per rate unit
units - the rate units

getSchedule

public Schedule<java.lang.Boolean> getSchedule()
Returns the schedule of area access restriction
Specified by:
getSchedule in interface IAreaNodeDescriptor<T extends Agent>

setSchedule

@AnyLogicInternalAPI
public void setSchedule​(Schedule<java.lang.Boolean> schedule)
Sets the schedule of area access restriction
Specified by:
setSchedule in interface IAreaNodeDescriptor<T extends Agent>

accessRestrictionCondition

public boolean accessRestrictionCondition​(T agent)
Evaluates the area access condition for the specified agent
Specified by:
accessRestrictionCondition in interface IAreaNodeDescriptor<T extends Agent>
Returns:
true if access restricted and false otherwise

isAvoidedIfClosed

public boolean isAvoidedIfClosed()
Returns the value of avoided if closed parameter
Specified by:
isAvoidedIfClosed in interface IAreaNodeDescriptor<T extends Agent>
Returns:
the value of avoided if closed parameter

setAvoidedIfClosed

public void setAvoidedIfClosed​(boolean avoided)
Sets the value of avoided if closed parameter
Specified by:
setAvoidedIfClosed in interface IAreaNodeDescriptor<T extends Agent>

setRestrictedAgentClass

public void setRestrictedAgentClass​(java.lang.Class<? extends Agent> restrictedClass)
Sets the restricted agent class
Specified by:
setRestrictedAgentClass in interface IAreaNodeDescriptor<T extends Agent>

getRestrictedAgentClass

public java.lang.Class<? extends Agent> getRestrictedAgentClass()
Returns the restricted agent class
Specified by:
getRestrictedAgentClass in interface IAreaNodeDescriptor<T extends Agent>
Returns:
restricted agent class

getMaxSpeed

public double getMaxSpeed​(SpeedUnits units)
Returns the maximum speed in the specified speed units
Specified by:
getMaxSpeed in interface IAreaNodeDescriptor<T extends Agent>
Overrides:
getMaxSpeed in class Node
Parameters:
units - speed units
Returns:
maximum speed in the specified speed units

setMaxSpeed

@Deprecated
public void setMaxSpeed​(double maxSpeed,
                        SpeedUnits units)
Deprecated.
Sets the maximum speed in the specified speed units
Specified by:
setMaxSpeed in interface IAreaNodeDescriptor<T extends Agent>
Overrides:
setMaxSpeed in class Node
Parameters:
maxSpeed - new max speed
units - speed units

setSpeedRestricted

@AnyLogicInternalAPI
public void setSpeedRestricted​(boolean restriction)
Sets the speed restriction in the area. May be called only before initialization.
Specified by:
setSpeedRestricted in interface IAreaNodeDescriptor<T extends Agent>

isSpeedRestricted

public boolean isSpeedRestricted()
Checks whether the area has speed restriction enabled. If true, the speed inside the area is restricted.
Specified by:
isSpeedRestricted in interface IAreaNodeDescriptor<T extends Agent>
Returns:
true if the speed is restricted and false otherwise
How can we improve this article?