|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jabm.agent.AbstractAgent
public abstract class AbstractAgent
An abstract superclass for JABM agents which provides default event-handling
functionality implementing several methods in the Agent
interface. The only requirement for an object to model a JABM agent is that
it implement the Agent
interface; agents do not have to subclass
AbstractAgent
.
![]() |
![]() |
Field Summary | |
---|---|
protected boolean |
interacted
|
protected EventScheduler |
scheduler
The event scheduler used to fire events originating from this agent. |
protected Strategy |
strategy
|
Constructor Summary | |
---|---|
AbstractAgent()
|
|
AbstractAgent(EventScheduler scheduler)
|
Method Summary | |
---|---|
void |
eventOccurred(SimEvent event)
|
void |
fireEvent(SimEvent event)
|
double |
getPayoffDelta()
|
EventScheduler |
getScheduler()
|
Strategy |
getStrategy()
|
boolean |
isInteracted()
Find out whether the agent has interacted with the environment or other agents. |
void |
onAgentArrival(AgentArrivalEvent event)
This method is called whenever an agent arrives at the simulation. |
void |
onRoundStarting(RoundStartingEvent event)
|
void |
onSimulationFinished(SimulationFinishedEvent event)
|
void |
setScheduler(EventScheduler scheduler)
Set the event scheduler for this agent. |
void |
setStrategy(Strategy strategy)
Configure the strategy for this agent. |
void |
subscribeToEvents()
Subscribe to the specific events that we are interested in. |
void |
unsubscribeFromEvents()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.jabm.agent.Agent |
---|
getPayoff, initialise |
Field Detail |
---|
protected boolean interacted
protected EventScheduler scheduler
protected Strategy strategy
Constructor Detail |
---|
public AbstractAgent(EventScheduler scheduler)
public AbstractAgent()
Method Detail |
---|
public void subscribeToEvents()
public void unsubscribeFromEvents()
public void eventOccurred(SimEvent event)
eventOccurred
in interface EventListener
public void onSimulationFinished(SimulationFinishedEvent event)
public void onRoundStarting(RoundStartingEvent event)
public void fireEvent(SimEvent event)
public EventScheduler getScheduler()
public void setScheduler(EventScheduler scheduler)
Agent
setScheduler
in interface Agent
public double getPayoffDelta()
getPayoffDelta
in interface Agent
public void onAgentArrival(AgentArrivalEvent event)
public boolean isInteracted()
Agent
isInteracted
in interface Agent
public Strategy getStrategy()
getStrategy
in interface Agent
Strategy
used by this agent.public void setStrategy(Strategy strategy)
setStrategy
in interface Agent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |