AnyLogic
Expand
Font size
All Superinterfaces:
AgentExtension, ExtAgentWithSpatialMetrics, ExtAnimationParams, ExtDefaultAnimationProvider, Serializable
All Known Implementing Classes:
ExtEntityContinuousDelegate, ExtEntityDelegate

public interface ExtEntity
extends ExtAgentWithSpatialMetrics, ExtDefaultAnimationProvider

Field Summary

Method Summary

Modifier and TypeMethodDescription
voidaddAgentToContents(Agent agent)
Adds a given agent to the contents of this agent.
List<Agent>contents() 
FlowchartBlockcurrentBlock()
Returns the current flowchart block this agent is being processed in.
voiddestroyEntity()
Destroys the agent.
doublegetBlockEnterTime()
Returns the time this agent entered its current flowchart block.
ColorgetColor()
Returns the color of the item default shape.
doublegetFlowchartEntryTime()
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
doublegetHeight()
Returns the height of the agent - used by conveyors and other blocks which require it during processing.
doublegetHeight(LengthUnits units)
Returns the height of the agent - used by conveyors and other blocks which require it during processing.
intgetId()
Returns Id of agent.
doublegetLength()
Returns the length of the agent - used by conveyors and other blocks which require it during processing.
doublegetLength(LengthUnits units)
Returns the length of the agent - used by conveyors and other blocks which require it during processing.
doublegetWidth()
Returns the width of the agent - used by conveyors and other blocks which require it during processing.
doublegetWidth(LengthUnits units)
Returns the width of the agent - used by conveyors and other blocks which require it during processing.
default voidhighlight(boolean yes)
Turns on/off highlighting of this agent animation.
booleanremoveAgentFromContents(Agent agent)
Removes the given agent from the contents of this agent.
AgentresourceUnitOfPool(Agent pool)
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(Agent pool)
Returns resource units currently seized by this agent from the given ResourcePool block
List<Agent>resourceUnitsOfSeize(Agent seize)
Return resource units currently seized by this agent in the given Seize block
voidsetColor(Color color)
Sets the color of the item default shape.
voidsetFlowchartActivityType(FlowchartActivityType activityType, FlowchartBlock block)
Sets activity type info (used in e.g.
voidsetHeight(double heightInMeters)
Sets the height of the agent (in meters)
voidsetHeight(double height, LengthUnits units)
Sets the height of the agent in the given units
voidsetLength(double lengthInMeters)
Sets the length of the agent (in meters)
voidsetLength(double length, LengthUnits units)
Sets the length of the agent in the given units
voidsetWidth(double widthInMeters)
Sets the width of the agent (in meters)
voidsetWidth(double width, LengthUnits units)
Sets the width of the agent in the given units

Methods inherited from interface com.anylogic.engine.AgentExtension

getAgent, next_xjal, onDestroy, onExtensionRemoved, priority, setNext_xjal, supportsInterface_xjal

Methods inherited from interface com.anylogic.engine.ExtAnimationParams

getAnimationPosition, getAnimationX, getAnimationY, getAnimationZ, getPresentationScaleOnOwnerSpace, getSpace, isAnimationVisible_xjal, setSpace

Methods inherited from interface com.anylogic.engine.ExtDefaultAnimationProvider

createDefaultAnimation, getDefaultAnimation, onClick

Method Details

getFlowchartEntryTime

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
Returns:
time or Double.NaN

addAgentToContents

void addAgentToContents(Agent agent)
Adds a given agent to the contents of this agent.
Parameters:
agent - the agent to add

removeAgentFromContents

boolean removeAgentFromContents(Agent agent)
Removes the given agent from the contents of this agent.
Parameters:
agent - the agent to remove
Returns:
returns true if agent was removed, false if this agent didn't contain the specified agent

getLength

double getLength()
Returns the length of the agent - used by conveyors and other blocks which require it during processing.
Returns:
the length of the agent

getLength

double getLength(LengthUnits units)
Returns the length of the agent - used by conveyors and other blocks which require it during processing.
Parameters:
units - units of length to be used
Returns:
the length of the agent
Since:
7.1

setLength

void setLength(double lengthInMeters)
Sets the length of the agent (in meters)
Parameters:
length - the length of the agent, measured in meters

setLength

void setLength(double length,
 LengthUnits units)
Sets the length of the agent in the given units
Parameters:
length - the length of the agent
units - units of length to be used
Since:
7.1

getWidth

double getWidth()
Returns the width of the agent - used by conveyors and other blocks which require it during processing.
Returns:
the width of the agent

getWidth

double getWidth(LengthUnits units)
Returns the width of the agent - used by conveyors and other blocks which require it during processing.
Parameters:
units - units of length to be used
Returns:
the width of the agent
Since:
8.2

setWidth

void setWidth(double widthInMeters)
Sets the width of the agent (in meters)
Parameters:
width - the width of the agent, measured in meters
Since:
8.2

setWidth

void setWidth(double width,
 LengthUnits units)
Sets the width of the agent in the given units
Parameters:
width - the width of the agent
units - units of length to be used
Since:
8.2

getHeight

double getHeight()
Returns the height of the agent - used by conveyors and other blocks which require it during processing.
Returns:
the height of the agent

getHeight

double getHeight(LengthUnits units)
Returns the height of the agent - used by conveyors and other blocks which require it during processing.
Parameters:
units - units of length to be used
Returns:
the height of the agent
Since:
8.2

setHeight

void setHeight(double heightInMeters)
Sets the height of the agent (in meters)
Parameters:
height - the height of the agent, measured in meters
Since:
8.2

setHeight

void setHeight(double height,
 LengthUnits units)
Sets the height of the agent in the given units
Parameters:
height - the height of the agent
units - units of length to be used
Since:
8.2

contents

List<Agent> contents()

resourceUnits

List<Agent> resourceUnits()
Returns the list of resource units seized by the agent, or empty list if there are none.
Returns:
the list of resource units seized by the agent, never returns null

resourceUnitsOfSeize

List<Agent> resourceUnitsOfSeize(Agent seize)
Return resource units currently seized by this agent in the given Seize block
Parameters:
seize - Seize block
Returns:
resource units currently seized by this agent

resourceUnitsOfPool

List<Agent> resourceUnitsOfPool(Agent pool)
Returns resource units currently seized by this agent from the given ResourcePool block
Parameters:
pool - ResourcePool block
Returns:
resource units currently seized by this agent

resourceUnitOfPool

Agent resourceUnitOfPool(Agent pool)
Returns the first occurrence of resource unit of a given pool among the seized resource units, or null if not found.
Parameters:
pool - the pool of the unit (ResourcePool block)
Returns:
the seized resource unit from the given pool, if found

currentBlock

FlowchartBlock currentBlock()
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.
Returns:
the current flowchart block containing this agent or null if the agent isn't in flowchart

getBlockEnterTime

double getBlockEnterTime()
Returns the time this agent entered its current flowchart block.
Returns:
the time this agent entered its current flowchart block or Double.NaN if this agent isn't in the flowchart

setColor

void setColor(Color color)
Sets the color of the item default shape.
Parameters:
color - the new color of the default shape

getId

int getId()
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.
Returns:
Id of agent

getColor

Color getColor()
Returns the color of the item default shape.
Returns:
the color of the item default shape

highlight

default void highlight(boolean yes)
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
Parameters:
yes -

destroyEntity

@AnyLogicInternalAPI
void destroyEntity()
Destroys the agent.

setFlowchartActivityType

@AnyLogicInternalAPI
void setFlowchartActivityType(FlowchartActivityType activityType,
 FlowchartBlock block)
Sets activity type info (used in e.g. logging to DB) for the given entity
See Also:
FlowchartActivityType