@AnyLogicInternalAPI public abstract class AreaNode<T extends Agent> extends Node implements IAreaNodeDescriptor<T>, java.lang.Iterable<T>
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
use
restrictSpeed(double, SpeedUnits) instead |
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.
use
restrictSpeed(double, SpeedUnits) instead |
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.
|
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, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside, randomPointInside
getSpace
getMarkup, setMarkup
setLevel
initializeInternal, onAggregatorVisibilityChanged, postInitialize
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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, boolean speedRestriction, double maxSpeedInMPS, PathEnd<Path>[] pathEnds, Attractor... attractors)
@AnyLogicInternalAPI public boolean isReadyToEnter(T agent)
public void addAttractor(Attractor attractor)
attractor
- attractor to be addedpublic abstract double area(AreaUnits units)
units
- the area unitspublic java.util.List<T> agents()
public java.util.List<T> getAgentsWaitingToEnter()
public int getNumberOfAdmittedAgents()
public int getNumberOfAdmittedTransporters()
public java.util.Iterator<T> iterator()
public double density(AreaUnits units)
units
- the area unitspublic void recalculateAccessibility()
AREA_ACCESS_RESTRICTION_BY_CONDITION
to notify transporters about changes in the area accessibilitypublic boolean contains(Agent agent)
agent
- the agent@AnyLogicInternalAPI public void addAreaDataSource(IAreaDataSource areaDataSource)
@AnyLogicInternalAPI public void removeAreaDataSource(IAreaDataSource areaDataSource)
@AnyLogicInternalAPI public java.util.List<Agent> getPeds()
public java.util.List<Agent> getAdmittedTransporters()
public void onEnterDenied(T agent)
onEnterDenied
in interface IAreaNodeDescriptor<T extends Agent>
agent
- the agentpublic void onEnter(T agent)
onEnter
in interface IAreaNodeDescriptor<T extends Agent>
agent
- the agentpublic void onExit(T agent)
onExit
in interface IAreaNodeDescriptor<T extends Agent>
agent
- the agentpublic void onClose()
onClose
in interface IAreaNodeDescriptor<T extends Agent>
public void onOpen()
onOpen
in interface IAreaNodeDescriptor<T extends Agent>
public boolean isAccessRestricted()
true
if the access to the area is restricted and false
otherwiseisAccessRestricted
in interface IAreaNodeDescriptor<T extends Agent>
true
if the access to the area is restricted and false
otherwise@AnyLogicInternalAPI public void setAccessRestricted(boolean restricted)
setAccessRestricted
in interface IAreaNodeDescriptor<T extends Agent>
public void restrictAccessByCapacity(int number)
number
- allowed capacitypublic void restrictAccessByThroughput(double throughput, RateUnits units)
throughput
- maximum number of agents per rate unitunits
- throughput rate unitpublic void restrictAccessBySchedule(Schedule<java.lang.Boolean> schedule)
schedule
- an object of class Scheduletrue
correspond to the time intervals during which the area is closed.public void restrictAccessManually(boolean initiallyClosed)
open()
, close()
or setOpen(boolean)
).initiallyClosed
- the initial state of area. Initially closed if true
and initially open otherwise.public void restrictSpeed(double maxSpeed, SpeedUnits units)
maxSpeed
- maximum allowed speed in the nodeunits
- speed unitspublic boolean isOpen()
public void setOpen(boolean open)
open
- setting parameter to true opens the area. Setting parameter to false closes the areapublic void open()
public void close()
@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()
public double getY()
public double getZ()
public double getZ(double x, double y)
public Slope getSlope()
public void setSlope(Slope slope)
slope
- - the slope for current areapublic void setPos(double x, double y, double z)
x
- the new value of x coordinatey
- the new value of y coordinatez
- the new value of z coordinatepublic void setLineColor(java.awt.Color lineColor)
setLineColor
in class Node
lineColor
- the new line color, null = do not draw the markup element linepublic void setLineColor(java.awt.Paint lineColor)
Texture
) of the markup element.setLineColor
in interface INode<Node,Path>
setLineColor
in class Node
lineColor
- the new line color, null = do not draw the markup element linepublic java.awt.Color getLineColor()
null
if markup element has no line color or
has textured line (in this case getLineTexture()
should be used instead)getLineColor
in interface INode<Node,Path>
getLineColor
in class Node
public Texture getLineTexture()
getLineTexture
in interface INode<Node,Path>
getLineTexture
in class Node
public java.awt.Color getFillColor()
null
if markup element has no fill color or
has textured fill (in this case getFillTexture()
should be used instead)getFillColor
in interface INode<Node,Path>
getFillColor
in class Node
public Texture getFillTexture()
getFillTexture
in interface INode<Node,Path>
getFillTexture
in class Node
public void setLineWidth(double width)
width
- the new line width of the markup elementpublic double getLineWidth()
public void setLineStyle(LineStyle lineStyle)
{LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
lineStyle
- the new style of the markup elementpublic LineStyle getLineStyle()
{LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED}
public Position getPosition(int index, int totalNumber, Position out)
AnimationStaticLocationProvider
getPosition
in interface AnimationStaticLocationProvider
index
- the index of some item positions, should be not negative and less than totalNumber
totalNumber
- the total number of item positions, should be positiveout
- output object to write to, may be null
public java.util.List<Attractor> getAttractors()
public PositionChoiceMode getPositionChoiceMode()
public void setPositionChoiceMode(PositionChoiceMode positionChoiceMode)
positionChoiceMode
- the position choice mode, which can be:
@Deprecated public void setLimitSpeed(boolean restriction)
restrictSpeed(double, SpeedUnits)
insteadNode
setLimitSpeed
in class Node
restriction
- argument flag@AnyLogicInternalAPI public boolean isLimitSpeed()
Node
isLimitSpeed
in class Node
public AreaAccessRestrictionType getAccessRestrictionType()
getAccessRestrictionType
in interface IAreaNodeDescriptor<T extends Agent>
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)
setAccessRestrictionType
in interface IAreaNodeDescriptor<T extends Agent>
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()
getCapacity
in interface IAreaNodeDescriptor<T extends Agent>
@AnyLogicInternalAPI public void setCapacity(int number)
setCapacity
in interface IAreaNodeDescriptor<T extends Agent>
number
- - allowed capacitypublic double getThroughput(RateUnits units)
getThroughput
in interface IAreaNodeDescriptor<T extends Agent>
units
- the rate units@AnyLogicInternalAPI public void setThroughput(double throughput, RateUnits units)
setThroughput
in interface IAreaNodeDescriptor<T extends Agent>
throughput
- maximum number of agents per rate unitunits
- the rate unitspublic Schedule<java.lang.Boolean> getSchedule()
getSchedule
in interface IAreaNodeDescriptor<T extends Agent>
@AnyLogicInternalAPI public void setSchedule(Schedule<java.lang.Boolean> schedule)
setSchedule
in interface IAreaNodeDescriptor<T extends Agent>
public boolean accessRestrictionCondition(T agent)
accessRestrictionCondition
in interface IAreaNodeDescriptor<T extends Agent>
true
if access restricted and false
otherwisepublic boolean isAvoidedIfClosed()
isAvoidedIfClosed
in interface IAreaNodeDescriptor<T extends Agent>
public void setAvoidedIfClosed(boolean avoided)
setAvoidedIfClosed
in interface IAreaNodeDescriptor<T extends Agent>
public void setRestrictedAgentClass(java.lang.Class<? extends Agent> restrictedClass)
setRestrictedAgentClass
in interface IAreaNodeDescriptor<T extends Agent>
public java.lang.Class<? extends Agent> getRestrictedAgentClass()
getRestrictedAgentClass
in interface IAreaNodeDescriptor<T extends Agent>
public double getMaxSpeed(SpeedUnits units)
getMaxSpeed
in interface IAreaNodeDescriptor<T extends Agent>
getMaxSpeed
in class Node
units
- speed units@Deprecated public void setMaxSpeed(double maxSpeed, SpeedUnits units)
restrictSpeed(double, SpeedUnits)
insteadsetMaxSpeed
in interface IAreaNodeDescriptor<T extends Agent>
setMaxSpeed
in class Node
maxSpeed
- new max speedunits
- speed units@AnyLogicInternalAPI public void setSpeedRestricted(boolean restriction)
setSpeedRestricted
in interface IAreaNodeDescriptor<T extends Agent>
public boolean isSpeedRestricted()
isSpeedRestricted
in interface IAreaNodeDescriptor<T extends Agent>
true
if the speed is restricted and false
otherwiseCopyright © AnyLogic North America, LLC. All Rights Reserved.