Class AbstractLocalStateOfAgent
- java.lang.Object
-
- fr.univ_artois.lgi2a.similar.microkernel.libs.abstractimpl.AbstractLocalState
-
- fr.univ_artois.lgi2a.similar.microkernel.libs.abstractimpl.AbstractLocalStateOfAgent
-
- All Implemented Interfaces:
ILocalStateOfAgent
,ILocalStateOfAgent4Engine
,ILocalState
- Direct Known Subclasses:
EmptyLocalStateOfAgent
public abstract class AbstractLocalStateOfAgent extends AbstractLocalState implements ILocalStateOfAgent4Engine
An abstract implementation of theILocalStateOfAgent
andILocalStateOfAgent4Engine
interfaces, providing a default behavior to their methods.- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLocalStateOfAgent(LevelIdentifier level, IAgent4Engine owner)
Builds an initialized instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentCategory
getCategoryOfAgent()
Gets the category of the agent owning this local state.IAgent4Engine
getOwner()
Gets the owner of the local state, i.e. the agent which public (resp. private) local state at a specific level is this object.boolean
isOwnedBy(IAgent agent)
Checks if an agent is the owner of a local state.-
Methods inherited from class fr.univ_artois.lgi2a.similar.microkernel.libs.abstractimpl.AbstractLocalState
getLevel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.univ_artois.lgi2a.similar.microkernel.ILocalState
getLevel
-
-
-
-
Constructor Detail
-
AbstractLocalStateOfAgent
protected AbstractLocalStateOfAgent(LevelIdentifier level, IAgent4Engine owner)
Builds an initialized instance of this class.- Parameters:
level
- The level for which this local state was defined.owner
- The agent owning this local state.
-
-
Method Detail
-
getOwner
public IAgent4Engine getOwner()
Gets the owner of the local state, i.e. the agent which public (resp. private) local state at a specific level is this object.This method is defined for optimization purposes, since keeping an association between local states and agents within the simulation engine would be too memory consuming.
- Specified by:
getOwner
in interfaceILocalStateOfAgent4Engine
- Returns:
- The owner of this state.
-
isOwnedBy
public boolean isOwnedBy(IAgent agent)
Checks if an agent is the owner of a local state.- Specified by:
isOwnedBy
in interfaceILocalStateOfAgent
- Parameters:
agent
- The agent which ownership is checked.- Returns:
true
if an agent is the owner of a local state.
-
getCategoryOfAgent
public AgentCategory getCategoryOfAgent()
Gets the category of the agent owning this local state.It returns the category of the agent "a" within the expression φ+a(t, l), φ-a(t, l) (public and private local state of an agent).
- Specified by:
getCategoryOfAgent
in interfaceILocalStateOfAgent
- Returns:
- The category of the agent owning this local state.
- See Also:
AgentCategory
-
-