Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.Node
- Methods inherited from class com.anylogic.engine.markup.NetworkMarkupElement
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AbstractPositionalMarkup
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.markup.AnimationStaticLocationProvider
- Methods inherited from interface com.anylogic.engine.markup.HasLevel
- Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor
- Methods inherited from interface com.anylogic.engine.markup.INetworkMarkupElement
- Methods inherited from interface com.anylogic.engine.markup.INode
- Methods inherited from interface java.lang.Iterable
- Methods inherited from interface com.anylogic.engine.markup.LevelElement
- Methods inherited from interface com.anylogic.engine.presentation.SVGElement
- Methods inherited from interface com.anylogic.engine.presentation.UsdElement
- Constructor Details
- Method Details
- isReadyToEnter
- addAttractor
- addAttractor
- area
- agents
- getAgentsWaitingToEnter
- getNumberOfAdmittedAgents
- getNumberOfAdmittedTransporters
- iterator
- density
- recalculateAccessibility
- contains
- addAreaDataSource
- removeAreaDataSource
- getPeds
- getAdmittedTransporters
- onEnterDenied
- onEnter
- onExit
- onClose
- onOpen
- isAccessRestricted
- setAccessRestricted
- restrictAccessByCapacity
- restrictAccessByThroughput
- restrictAccessBySchedule
- restrictAccessManually
- restrictSpeed
- isOpen
- setOpen
- open
- close
- notifyReadyToEnter
- notifyReadyToEnter2
- notifyCancelReadyToEnter
- addAgent
- removeAgent
- removeFromQueue
- isAllowedToEnter
- isApplied
- notifyReadyToExit
- getX
- getY
- getZ
- getZ
- getSlope
- setSlope
- setPos
- setLineColor
- setLineColor
- getLineColor
- getLineTexture
- getFillColor
- getFillTexture
- setLineWidth
- getLineWidth
- setLineStyle
- getLineStyle
- getPosition
- getAttractors
- getPositionChoiceMode
- setPositionChoiceMode
- setLimitSpeed
- isLimitSpeed
- getAccessRestrictionType
- setAccessRestrictionType
- getCapacity
- setCapacity
- getThroughput
- setThroughput
- getSchedule
- setSchedule
- accessRestrictionCondition
- isAvoidedIfClosed
- setAvoidedIfClosed
- setRestrictedAgentClass
- getRestrictedAgentClass
- getMaxSpeed
- setMaxSpeed
- setSpeedRestricted
- isSpeedRestricted
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.NetworkMarkupElement
- com.anylogic.engine.markup.Node
- com.anylogic.engine.markup.AreaNode<T>
- All Implemented Interfaces:
AbstractPositionalMarkup
,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
,UsdElement
,Serializable
,Iterable<T>
- Direct Known Subclasses:
PolygonalNode
,RectangularNode
@AnyLogicInternalAPI public abstract class AreaNode<T extends Agent> extends Node implements IAreaNodeDescriptor<T>, Iterable<T>, AbstractPositionalMarkup
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AreaNode() | |
AreaNode | |
AreaNode |
Deprecated.
|
AreaNode |
Modifier and Type | Method | Description |
---|---|---|
boolean | accessRestrictionCondition |
Evaluates the area access condition for the specified agent
|
void | addAgent | |
void | addAreaDataSource | |
void | addAttractor |
Sets the position choice mode to PositionChoiceMode.POSITION_CHOICE_BY_ATTRACTORS
and adds the specified attractor to this area.
|
void | addAttractor |
Deprecated.
|
List<T> | agents() |
Returns the list of agents currently present in this area.
|
abstract double | area |
Returns the area of this area, measured in area units
|
void | close() |
Closes the area.
|
boolean | contains |
Returns true, if the area contains the specified agent, otherwise returns false.
|
double | density |
Returns the average value of density inside the area, measured in agents per area units.
|
AreaAccessRestrictionType | getAccessRestrictionType() |
Returns access restriction type.
|
List<Agent> | getAdmittedTransporters() |
Returns the list of transporters admitted to the area.
|
List<T> | getAgentsWaitingToEnter() |
Returns a list of agents waiting in the queue to enter the area.
|
List<Attractor> | getAttractors() |
Returns the list of this area attractors
|
int | getCapacity() |
Returns capacity for access restriction
|
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
|
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 |
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.
|
List<Agent> | getPeds() |
Returns the list of pedestrians currently present in this area.
|
Position | getPosition |
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.
|
Class<? extends Agent> | getRestrictedAgentClass() |
Returns the restricted agent class
|
Schedule<Boolean> | getSchedule() |
Returns the schedule of area access restriction
|
Slope | getSlope() |
Returns the slope for current area
|
double | getThroughput |
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 |
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 | |
boolean | isApplied | |
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 | |
boolean | isSpeedRestricted() |
Checks whether the area has speed restriction enabled.
|
Iterator<T> | iterator() |
Returns the iterator for all agents inside the area.
|
void | notifyCancelReadyToEnter | |
boolean | notifyReadyToEnter | |
void | notifyReadyToEnter2 | |
void | notifyReadyToExit | |
void | onClose() |
Code executed when the area closes.
|
void | onEnter |
Code executed when the agent enters the area.
|
void | onEnterDenied |
Code that will be executed when the agent attempts to enter the node but is not allowed to.
|
void | onExit |
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 | |
void | removeAreaDataSource | |
void | removeFromQueue | |
void | restrictAccessByCapacity |
Enables restriction of access to the node by capacity.
|
void | restrictAccessBySchedule |
Enables restriction of access to the node by schedule.
|
void | restrictAccessByThroughput |
Enables restriction of access to the node by throughput.
|
void | restrictAccessManually |
Enables restriction of access to the node manually.
|
void | restrictSpeed |
Enables speed restriction for the node.
|
void | setAccessRestricted |
Sets restriction of access.
|
void | setAccessRestrictionType |
Sets access restriction type.
|
void | setAvoidedIfClosed |
Sets the value of avoided if closed parameter
|
void | setCapacity |
Sets capacity for access restriction
|
void | setLimitSpeed |
Deprecated.
|
void | setLineColor |
Sets the line color of the markup element.
|
void | setLineColor |
Sets the line color (or
Texture ) of the markup element. |
void | setLineStyle |
Sets the line style of the markup element:
{LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED} |
void | setLineWidth |
Sets the line width of the markup element, 0 means thinnest possible
|
void | setMaxSpeed |
Deprecated.
use
restrictSpeed(double, SpeedUnits) instead |
void | setOpen |
Makes the area either open or closed to the incoming agents.
|
void | setPos |
Sets coordinates of the markup element
|
void | setPositionChoiceMode |
Sets the position choice mode for this area.
|
void | setRestrictedAgentClass |
Sets the restricted agent class
|
void | setSchedule |
Sets the schedule of area access restriction
|
void | setSlope |
Sets the slope for current area
|
void | setSpeedRestricted |
Sets the speed restriction in the area.
|
void | setThroughput |
Sets the maximum number of agents that can enter the area per rate unit.
|
addConnection, getCompatibleAgentExtensionClass, getConnection, getConnectionsCount, getMaterialLibraryDescriptor, getNumberOfTransporters, getTransferDistance, getTransferPositionByPercent, getTransporter, getTransporters, setFillColor, setFillColor
getDrawMode, getLevel, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNetwork, setLevel
contains, error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getOrGenerateUSDId, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor
getMarkup, setMarkup
contains, getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside, randomPointInside
public AreaNode()
public AreaNode(Agent owner)
@AnyLogicInternalCodegenAPI public AreaNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> areaNodeDescriptor, double x, double y, double z, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)
@Deprecated public AreaNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, boolean speedRestriction, double maxSpeedInMPS, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
@AnyLogicInternalAPI public boolean isReadyToEnter(T agent)
@Deprecated public void addAttractor(Attractor attractor)
Deprecated.
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
public void addAttractor(double x, double y, double orientation)
Sets the position choice mode to PositionChoiceMode.POSITION_CHOICE_BY_ATTRACTORS
and adds the specified attractor to this area. Area should be uninitialized.
- Parameters:
x
- the absolute x coordinatey
- the absolute y coordinateorientation
- the orientation in radians, clockwise, see alsoMath.toRadians(double)
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
public List<T> agents()
Returns the list of agents currently present in this area.
- Returns:
- the list of agents currently present in this area.
public 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.
public int getNumberOfAdmittedAgents()
Returns the number of agents admitted to the area.
- Returns:
- the number of agents admitted to the area.
public int getNumberOfAdmittedTransporters()
Returns the number of transporters admitted to the area.
- Returns:
- the number of transporters admitted to the area.
public Iterator<T> iterator()
Returns the iterator for all agents inside the area.
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.
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 accessibilitypublic 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.
@AnyLogicInternalAPI public void addAreaDataSource(IAreaDataSource areaDataSource)
@AnyLogicInternalAPI public void removeAreaDataSource(IAreaDataSource areaDataSource)
@AnyLogicInternalAPI public List<Agent> getPeds()
Returns the list of pedestrians currently present in this area.
- Returns:
- the list of pedestrians currently present in this area.
public List<Agent> getAdmittedTransporters()
Returns the list of transporters admitted to the area.
- Returns:
- returns transporters admitted to the area..
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 interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
agent
- the agent
public void onEnter(T agent)
Code executed when the agent enters the area.
- Specified by:
onEnter
in interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
agent
- the agent
public void onExit(T agent)
Code executed when the agent exits the area.
- Specified by:
onExit
in interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
agent
- the agent
public void onClose()
Code executed when the area closes.
- Specified by:
onClose
in interfaceIAreaNodeDescriptor<T extends Agent>
public void onOpen()
Code executed when the area opens.
- Specified by:
onOpen
in interfaceIAreaNodeDescriptor<T extends Agent>
public boolean isAccessRestricted()
Returns
true
if the access to the area is restricted and false
otherwise- Specified by:
isAccessRestricted
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
true
if the access to the area is restricted andfalse
otherwise
@AnyLogicInternalAPI public void setAccessRestricted(boolean restricted)
Sets restriction of access. May be called only before initialization
- Specified by:
setAccessRestricted
in interfaceIAreaNodeDescriptor<T extends Agent>
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
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 unitunits
- throughput rate unit
public void restrictAccessBySchedule(Schedule<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.
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 iftrue
and initially open otherwise.
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 nodeunits
- speed units
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.
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
public void open()
Opens the area.
public void close()
Closes the area.
@AnyLogicInternalLibraryAPI public boolean notifyReadyToEnter(T agent)
@AnyLogicInternalLibraryAPI public void notifyReadyToEnter2(T agent)
@AnyLogicInternalLibraryAPI public void notifyCancelReadyToEnter(T agent)
@AnyLogicInternalLibraryAPI public void addAgent(T agent)
@AnyLogicInternalLibraryAPI public void removeAgent(T agent)
@AnyLogicInternalAPI public void removeFromQueue(T agent)
@AnyLogicInternalLibraryAPI public boolean isAllowedToEnter(T agent)
@AnyLogicInternalLibraryAPI public boolean isApplied(T agent)
@AnyLogicInternalLibraryAPI public void notifyReadyToExit(T agent)
public double getX()
Returns the x coordinate of the markup element.
- Specified by:
getX
in interfaceAbstractPositionalMarkup
- Returns:
- the x coordinate of the markup element
public double getY()
Returns the y coordinate of the markup element.
- Specified by:
getY
in interfaceAbstractPositionalMarkup
- Returns:
- the y coordinate of the markup element
public double getZ()
Returns the z coordinate of the markup element, relative to level/network, if any is defined.
- Specified by:
getZ
in interfaceAbstractPositionalMarkup
- Specified by:
getZ
in classNode
- Returns:
- the z coordinate of the markup element
public double getZ(double x, double y)
Returns the z coordinate of the given point
- Returns:
- the z coordinate of the given point
public Slope getSlope()
Returns the slope for current area
- Returns:
- the slope for current area
public void setSlope(Slope slope)
Sets the slope for current area
- Parameters:
slope
- - the slope for current area
public void setPos(double x, double y, double z)
Sets coordinates of the markup element
- Parameters:
x
- the new value of x coordinatey
- the new value of y coordinatez
- the new value of z coordinate
public void setLineColor(Color lineColor)
Sets the line color of the markup element.
- Specified by:
setLineColor
in classNode
- Parameters:
lineColor
- the new line color, null = do not draw the markup element line
public void setLineColor(Paint lineColor)
Sets the line color (or
Texture
) of the markup element.- Specified by:
setLineColor
in interfaceINode<Node,
Path> - Specified by:
setLineColor
in classNode
- Parameters:
lineColor
- the new line color, null = do not draw the markup element line
public 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 interfaceINode<Node,
Path> - Specified by:
getLineColor
in classNode
- Returns:
- the line color of the markup element
public Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
- Specified by:
getLineTexture
in interfaceINode<Node,
Path> - Specified by:
getLineTexture
in classNode
- Returns:
- the line texture of the markup element
public 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 interfaceINode<Node,
Path> - Overrides:
getFillColor
in classNode
- Returns:
- the fill color of the markup element
public Texture getFillTexture()
Returns the fill texture of the markup element, if the markup element has fill texture
- Specified by:
getFillTexture
in interfaceINode<Node,
Path> - Overrides:
getFillTexture
in classNode
- Returns:
- the fill texture of the markup element
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
public double getLineWidth()
Returns the line width of the markup element.
- Returns:
- the line width of the markup element
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
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
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).
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
- Specified by:
getPosition
in interfaceAnimationStaticLocationProvider
- Parameters:
index
- the index of some item positions, should be not negative and less thantotalNumber
totalNumber
- the total number of item positions, should be positiveout
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the requested item position
public List<Attractor> getAttractors()
Returns the list of this area attractors
- Returns:
- the attractors of this area
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
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
@Deprecated public void setLimitSpeed(boolean restriction)
Deprecated.
use
restrictSpeed(double, SpeedUnits)
insteadDescription 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 classNode
- Parameters:
restriction
- argument flag
@AnyLogicInternalAPI public boolean isLimitSpeed()
Description copied from class:
Node
Return true if speed is limited in this node, false otherwise
- Overrides:
isLimitSpeed
in classNode
public AreaAccessRestrictionType getAccessRestrictionType()
Returns access restriction type.
- Specified by:
getAccessRestrictionType
in interfaceIAreaNodeDescriptor<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
@AnyLogicInternalAPI public void setAccessRestrictionType(AreaAccessRestrictionType accessRestrictionType)
Sets access restriction type. May be called only before initialization.
- Specified by:
setAccessRestrictionType
in interfaceIAreaNodeDescriptor<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
public int getCapacity()
Returns capacity for access restriction
- Specified by:
getCapacity
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
- capacity for access restriction
@AnyLogicInternalAPI public void setCapacity(int number)
Sets capacity for access restriction
- Specified by:
setCapacity
in interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
number
- - allowed capacity
public double getThroughput(RateUnits units)
Returns the maximum number of agents that can enter the area per rate unit.
- Specified by:
getThroughput
in interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
units
- the rate units- Returns:
- maximum number of agents per rate unit
@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 interfaceIAreaNodeDescriptor<T extends Agent>
- Parameters:
throughput
- maximum number of agents per rate unitunits
- the rate units
public Schedule<Boolean> getSchedule()
Returns the schedule of area access restriction
- Specified by:
getSchedule
in interfaceIAreaNodeDescriptor<T extends Agent>
@AnyLogicInternalAPI public void setSchedule(Schedule<Boolean> schedule)
Sets the schedule of area access restriction
- Specified by:
setSchedule
in interfaceIAreaNodeDescriptor<T extends Agent>
public boolean accessRestrictionCondition(T agent)
Evaluates the area access condition for the specified agent
- Specified by:
accessRestrictionCondition
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
true
if access restricted andfalse
otherwise
public boolean isAvoidedIfClosed()
Returns the value of avoided if closed parameter
- Specified by:
isAvoidedIfClosed
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
- the value of avoided if closed parameter
public void setAvoidedIfClosed(boolean avoided)
Sets the value of avoided if closed parameter
- Specified by:
setAvoidedIfClosed
in interfaceIAreaNodeDescriptor<T extends Agent>
public void setRestrictedAgentClass(Class<? extends Agent> restrictedClass)
Sets the restricted agent class
- Specified by:
setRestrictedAgentClass
in interfaceIAreaNodeDescriptor<T extends Agent>
public Class<? extends Agent> getRestrictedAgentClass()
Returns the restricted agent class
- Specified by:
getRestrictedAgentClass
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
- restricted agent class
public double getMaxSpeed(SpeedUnits units)
Returns the maximum speed in the specified speed units
- Specified by:
getMaxSpeed
in interfaceIAreaNodeDescriptor<T extends Agent>
- Overrides:
getMaxSpeed
in classNode
- Parameters:
units
- speed units- Returns:
- maximum speed in the specified speed units
@Deprecated public void setMaxSpeed(double maxSpeed, SpeedUnits units)
Deprecated.
use
restrictSpeed(double, SpeedUnits)
insteadSets the maximum speed in the specified speed units
- Specified by:
setMaxSpeed
in interfaceIAreaNodeDescriptor<T extends Agent>
- Overrides:
setMaxSpeed
in classNode
- Parameters:
maxSpeed
- new max speedunits
- speed units
@AnyLogicInternalAPI public void setSpeedRestricted(boolean restriction)
Sets the speed restriction in the area. May be called only before initialization.
- Specified by:
setSpeedRestricted
in interfaceIAreaNodeDescriptor<T extends Agent>
public boolean isSpeedRestricted()
Checks whether the area has speed restriction enabled. If true, the speed inside the area is restricted.
- Specified by:
isSpeedRestricted
in interfaceIAreaNodeDescriptor<T extends Agent>
- Returns:
true
if the speed is restricted andfalse
otherwise
restrictSpeed(double, SpeedUnits)
instead