Package modelarium.entities.contexts
Interface AgentContext
- All Superinterfaces:
Context,EntityContext
- All Known Implementing Classes:
AgentSimulationContext
Interface for providing an agent's attributes with access to their owning agent and the wider model.
This interface is the view of the simulation an agent's attributes are given, exposing the agent itself, the attribute set and attribute currently being run, and the model's environment.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the model's environment.Returns the attribute currently being run on the owning agent.Returns the attribute set currently being run on the owning agent.Returns the agent this context belongs to.Methods inherited from interface modelarium.entities.contexts.Context
doesAgentExistInThisCore, getAgent, getClock, getCurrentPopulationSize, getFilteredAgents, getFilteredAgents, getRandom, killAgent, killAgent, killAgents, killAgentsMethods inherited from interface modelarium.entities.contexts.EntityContext
addAgent, addAgents, addAgents
-
Method Details
-
getThisEntity
Agent getThisEntity()Returns the agent this context belongs to.- Returns:
- the owning
Agentinstance
-
getThisAttributeSet
AgentAttributeSet getThisAttributeSet()Returns the attribute set currently being run on the owning agent.- Returns:
- the current
AgentAttributeSetinstance
-
getThisAttribute
AttributeBase<AgentSimulationContext> getThisAttribute()Returns the attribute currently being run on the owning agent.- Returns:
- the current attribute instance
-
getEnvironment
ReadOnlyEnvironment getEnvironment()Returns the model's environment.- Returns:
- a read-only view of the model's
Environment
-