public abstract class AbstractAgent extends Object implements Serializable, Agent
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
.Modifier and Type | Field and Description |
---|---|
protected boolean |
interacted |
protected EventScheduler |
scheduler
The event scheduler used to fire events originating from this agent.
|
protected Strategy |
strategy |
Constructor and Description |
---|
AbstractAgent() |
AbstractAgent(EventScheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPayoff, initialise
protected boolean interacted
protected EventScheduler scheduler
protected Strategy strategy
public AbstractAgent(EventScheduler scheduler)
public AbstractAgent()
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
Copyright © 2014. All rights reserved.