Package com.anylogic.engine
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.ExtAgentWithSpatialMetricsDelegate
- Methods inherited from class com.anylogic.engine.AgentExtensionImpl
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.AgentExtension
- Methods inherited from interface com.anylogic.engine.ExtAgentWithSpatialMetrics
- Methods inherited from interface com.anylogic.engine.ExtAnimationParams
- Constructor Details
- Method Details
- destroyEntity
- highlight
- getId
- getFlowchartEntryTime
- addAgentToContents
- removeAgentFromContents
- getLength
- getLength
- setLength
- setLength
- getWidth
- getWidth
- setWidth
- setWidth
- getHeight
- getHeight
- setHeight
- setHeight
- contents
- resourceUnits
- resourceUnitsOfSeize
- resourceUnitsOfPool
- resourceUnitOfPool
- currentBlock
- getBlockEnterTime
- setColor
- getColor
- getDefaultAnimation
- createDefaultAnimation
- onClick
- setFlowchartActivityType
- priority
- java.lang.Object
- com.anylogic.engine.AgentExtensionImpl
- com.anylogic.engine.ExtAgentWithSpatialMetricsDelegate<E>
- com.anylogic.engine.ExtEntityDelegate<E>
- Type Parameters:
E
- type of agent extension to delegate to. If you are creating new extension based on 'Entity', please set the type toExtEntity
- All Implemented Interfaces:
AgentExtension
,ExtAgentWithSpatialMetrics
,ExtAnimationParams
,ExtDefaultAnimationProvider
,ExtEntity
,Serializable
@AnyLogicInternalAPI public abstract class ExtEntityDelegate<E extends ExtEntity> extends ExtAgentWithSpatialMetricsDelegate<E> implements ExtEntity
Base class for extensions delegating their 'Entity' activity to an existing extension of agent
- See Also:
- Serialized Form
Constructor | Description |
---|---|
ExtEntityDelegate |
Modifier and Type | Method | Description |
---|---|---|
void | addAgentToContents |
Adds a given agent to the contents of this agent.
|
List<Agent> | contents() | |
ShapeTopLevelPresentationGroup | createDefaultAnimation() | |
FlowchartBlock | currentBlock() |
Returns the current flowchart block this agent
is being processed in.
|
void | destroyEntity() |
Destroys the agent.
|
double | getBlockEnterTime() |
Returns the time this agent entered its current flowchart block.
|
Color | getColor() |
Returns the color of the item default shape.
|
ShapeTopLevelPresentationGroup | getDefaultAnimation() | |
double | getFlowchartEntryTime() |
Returns the time the agent has entered the first block in the flowchart,
or
Double.NaN if this agent hasn't yet visited any flowchart |
double | getHeight() |
Returns the height of the agent - used by conveyors and
other blocks which require it during processing.
|
double | getHeight |
Returns the height of the agent - used by conveyors and
other blocks which require it during processing.
|
int | getId() |
Returns Id of agent.
|
double | getLength() |
Returns the length of the agent - used by conveyors and
other blocks which require it during processing.
|
double | getLength |
Returns the length of the agent - used by conveyors and
other blocks which require it during processing.
|
double | getWidth() |
Returns the width of the agent - used by conveyors and
other blocks which require it during processing.
|
double | getWidth |
Returns the width of the agent - used by conveyors and
other blocks which require it during processing.
|
void | highlight |
Turns on/off highlighting of this agent animation.
|
boolean | onClick() |
Should be overridden to define the reaction on mouse click.
|
int | priority() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. This function is used for sorting extensions (in order for the overriding delegation to work) |
boolean | removeAgentFromContents |
Removes the given agent from the contents of this agent.
|
Agent | resourceUnitOfPool |
Returns the first occurrence of resource unit of a given pool
among the seized resource units, or
null if not found. |
List<Agent> | resourceUnits() |
Returns the list of resource units seized by the agent, or empty list
if there are none.
|
List<Agent> | resourceUnitsOfPool |
Returns resource units currently seized by this agent
from the given
ResourcePool block |
List<Agent> | resourceUnitsOfSeize |
Return resource units currently seized by this agent
in the given
Seize block |
void | setColor |
Sets the color of the item default shape.
|
void | setFlowchartActivityType |
Sets activity type info (used in e.g.
|
void | setHeight |
Sets the height of the agent (in meters)
|
void | setHeight |
Sets the height of the agent in the given units
|
void | setLength |
Sets the length of the agent (in meters)
|
void | setLength |
Sets the length of the agent in the given units
|
void | setWidth |
Sets the width of the agent (in meters)
|
void | setWidth |
Sets the width of the agent in the given units
|
agentsInRange, agentsInRange, distanceTo, distanceTo, distanceTo, distanceTo, distanceTo, distanceTo, e, extClass, getAnimationPosition, getAnimationX, getAnimationY, getAnimationZ, getLevel, getNearestAgent, getNetwork, getNetworkNode, getPresentationScaleOnOwnerSpace, getRouteProvider, getSpace, getSpaceType, getSpeed, getSpeed, getTargetX, getTargetY, getVelocity, isAnimationVisible_xjal, isAutomaticHorizontalRotation, isAutomaticVerticalRotation, isMoving, jumpTo, jumpTo, jumpTo, moveTo, moveTo, moveTo, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToNearestAgent, moveToNearestAgent, moveToStraight, moveToStraightInTime, moveToStraightInTime, onExtensionRemoved, setArrivalCallback, setAutomaticHorizontalRotation, setLevel, setNetwork, setNetworkInternal, setNetworkNode, setNetworkNode, setRouteProvider, setSpace, setSpeed, setSpeed, setVelocity, stop, timeToArrival, timeToArrival, updatePosition
error, error, getAgent, getSupportedInterfaces_xjal, next_xjal, onDestroy, setNext_xjal, supportsInterface_xjal
agentsInRange, agentsInRange, distanceTo, distanceTo, distanceTo, distanceTo, distanceTo, distanceTo, getLevel, getNearestAgent, getNetwork, getNetworkNode, getRouteProvider, getSpaceType, getSpeed, getSpeed, getTargetX, getTargetY, getVelocity, isAutomaticHorizontalRotation, isMoving, jumpTo, jumpTo, jumpTo, moveTo, moveTo, moveTo, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToNearestAgent, moveToNearestAgent, moveToStraight, moveToStraightInTime, moveToStraightInTime, setArrivalCallback, setAutomaticHorizontalRotation, setLevel, setNetwork, setNetworkInternal, setNetworkNode, setNetworkNode, setRouteProvider, setSpeed, setSpeed, setVelocity, stop, timeToArrival, timeToArrival, updatePosition
public ExtEntityDelegate(Agent owner)
@AnyLogicInternalAPI public void destroyEntity()
Description copied from interface:
ExtEntity
Destroys the agent.
- Specified by:
destroyEntity
in interfaceExtEntity
public void highlight(boolean yes)
Description copied from interface:
ExtEntity
Turns on/off highlighting of this agent animation.
The behavior of the function is specific for different agent types
and usually depends on the library which drives this agent
public int getId()
Description copied from interface:
ExtEntity
Returns Id of agent. This method is designed only for debug purposes.
It doesn't guarantees that id is unique.
Note that when the model produces more than ~billion agents then there may be agents with negative and even equal ids.
Note that when the model produces more than ~billion agents then there may be agents with negative and even equal ids.
public double getFlowchartEntryTime()
Description copied from interface:
ExtEntity
Returns the time the agent has entered the first block in the flowchart,
or
Double.NaN
if this agent hasn't yet visited any flowchart- Specified by:
getFlowchartEntryTime
in interfaceExtEntity
- Returns:
- time or
Double.NaN
public void addAgentToContents(Agent entity)
Description copied from interface:
ExtEntity
Adds a given agent to the contents of this agent.
- Specified by:
addAgentToContents
in interfaceExtEntity
- Parameters:
entity
- the agent to add
public boolean removeAgentFromContents(Agent entity)
Description copied from interface:
ExtEntity
Removes the given agent from the contents of this agent.
- Specified by:
removeAgentFromContents
in interfaceExtEntity
- Parameters:
entity
- the agent to remove- Returns:
- returns
true
ifagent
was removed,false
if this agent didn't contain the specifiedagent
public double getLength()
Description copied from interface:
ExtEntity
Returns the length of the agent - used by conveyors and
other blocks which require it during processing.
public double getLength(LengthUnits units)
Description copied from interface:
ExtEntity
Returns the length of the agent - used by conveyors and
other blocks which require it during processing.
public void setLength(double length)
Description copied from interface:
ExtEntity
Sets the length of the agent (in meters)
public void setLength(double length, LengthUnits units)
Description copied from interface:
ExtEntity
Sets the length of the agent in the given units
public double getWidth()
Description copied from interface:
ExtEntity
Returns the width of the agent - used by conveyors and
other blocks which require it during processing.
public double getWidth(LengthUnits units)
Description copied from interface:
ExtEntity
Returns the width of the agent - used by conveyors and
other blocks which require it during processing.
public void setWidth(double width)
Description copied from interface:
ExtEntity
Sets the width of the agent (in meters)
public void setWidth(double width, LengthUnits units)
Description copied from interface:
ExtEntity
Sets the width of the agent in the given units
public double getHeight()
Description copied from interface:
ExtEntity
Returns the height of the agent - used by conveyors and
other blocks which require it during processing.
public double getHeight(LengthUnits units)
Description copied from interface:
ExtEntity
Returns the height of the agent - used by conveyors and
other blocks which require it during processing.
public void setHeight(double height)
Description copied from interface:
ExtEntity
Sets the height of the agent (in meters)
public void setHeight(double height, LengthUnits units)
Description copied from interface:
ExtEntity
Sets the height of the agent in the given units
public List<Agent> contents()
public List<Agent> resourceUnits()
Description copied from interface:
ExtEntity
Returns the list of resource units seized by the agent, or empty list
if there are none.
- Specified by:
resourceUnits
in interfaceExtEntity
- Returns:
- the list of resource units seized by the agent, never returns
null
public List<Agent> resourceUnitsOfSeize(Agent seize)
Description copied from interface:
ExtEntity
Return resource units currently seized by this agent
in the given
Seize
block- Specified by:
resourceUnitsOfSeize
in interfaceExtEntity
- Parameters:
seize
-Seize
block- Returns:
- resource units currently seized by this agent
public List<Agent> resourceUnitsOfPool(Agent pool)
Description copied from interface:
ExtEntity
Returns resource units currently seized by this agent
from the given
ResourcePool
block- Specified by:
resourceUnitsOfPool
in interfaceExtEntity
- Parameters:
pool
-ResourcePool
block- Returns:
- resource units currently seized by this agent
public Agent resourceUnitOfPool(Agent pool)
Description copied from interface:
ExtEntity
Returns the first occurrence of resource unit of a given pool
among the seized resource units, or
null
if not found.- Specified by:
resourceUnitOfPool
in interfaceExtEntity
- Parameters:
pool
- the pool of the unit (ResourcePool block)- Returns:
- the seized resource unit from the given pool, if found
public FlowchartBlock currentBlock()
Description copied from interface:
ExtEntity
Returns the current flowchart block this agent
is being processed in. This method is designed for
agents which act as 'entities' in process flowchart diagrams.
- Specified by:
currentBlock
in interfaceExtEntity
- Returns:
- the current flowchart block containing this agent
or
null
if the agent isn't in flowchart
public double getBlockEnterTime()
Description copied from interface:
ExtEntity
Returns the time this agent entered its current flowchart block.
- Specified by:
getBlockEnterTime
in interfaceExtEntity
- Returns:
- the time this agent entered its current flowchart block or
Double.NaN
if this agent isn't in the flowchart
public void setColor(Color color)
Description copied from interface:
ExtEntity
Sets the color of the item default shape.
public Color getColor()
Description copied from interface:
ExtEntity
Returns the color of the item default shape.
public ShapeTopLevelPresentationGroup getDefaultAnimation()
- Specified by:
getDefaultAnimation
in interfaceExtDefaultAnimationProvider
@AnyLogicInternalAPI public ShapeTopLevelPresentationGroup createDefaultAnimation()
- Specified by:
createDefaultAnimation
in interfaceExtDefaultAnimationProvider
@AnyLogicInternalAPI public boolean onClick()
Description copied from interface:
ExtDefaultAnimationProvider
Should be overridden to define the reaction on mouse click.
- Specified by:
onClick
in interfaceExtDefaultAnimationProvider
- Returns:
- always return
false
here.
public void setFlowchartActivityType(FlowchartActivityType activityType, FlowchartBlock block)
Description copied from interface:
ExtEntity
Sets activity type info (used in e.g. logging to DB) for the given entity
- Specified by:
setFlowchartActivityType
in interfaceExtEntity
- See Also:
-
FlowchartActivityType
public int priority()
Description copied from interface:
AgentExtension
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
- Specified by:
priority
in interfaceAgentExtension
- Overrides:
priority
in classExtAgentWithSpatialMetricsDelegate<E extends ExtEntity>
- Returns:
- int value, see also
P_*
constants