public class SimplePotentialAgent extends Object implements PotentialAgent, Initialisable
| Modifier and Type | Field and Description |
|---|---|
protected ModelData |
data |
protected double |
givingIn |
protected double |
givingUp |
protected String |
id |
protected RunInfo |
info |
protected Logger |
log |
protected ProductionModel |
production |
protected Set<PotentialAgentProductionObserver> |
productionObserver |
protected int |
serialID |
NOT_MANAGED_TYPE, UNKNOWN_SERIAL| Constructor and Description |
|---|
SimplePotentialAgent() |
SimplePotentialAgent(String id,
ModelData data,
ProductionModel production,
double givingUp,
double givingIn) |
| Modifier and Type | Method and Description |
|---|---|
Agent |
createAgent(Region region,
Cell... cells)
Create a new agent from this potential agent in the given region and
assign it as owner of the given cells.
|
double |
getGivingIn() |
double |
getGivingUp() |
String |
getID() |
com.moseph.modelutils.fastdata.DoubleMap<Service> |
getPotentialSupply(Cell cell) |
ProductionModel |
getProduction()
In case the production model is changed, a call to
productionModelChanged() is mandatory!
TODO make ProductionModel immutable |
int |
getSerialID() |
void |
initialise(ModelData data,
RunInfo info,
Region r) |
void |
productionModelChanged() |
void |
registerPotentialAgentProductionObserver(PotentialAgentProductionObserver observer) |
void |
removePotentialAgentProductionObserver(PotentialAgentProductionObserver observer) |
String |
toString() |
protected ProductionModel production
protected double givingUp
protected double givingIn
protected String id
protected int serialID
protected ModelData data
protected RunInfo info
protected Logger log
protected Set<PotentialAgentProductionObserver> productionObserver
public SimplePotentialAgent()
public SimplePotentialAgent(String id, ModelData data, ProductionModel production, double givingUp, double givingIn)
public com.moseph.modelutils.fastdata.DoubleMap<Service> getPotentialSupply(Cell cell)
getPotentialSupply in interface PotentialAgentpublic Agent createAgent(Region region, Cell... cells)
PotentialAgentcreateAgent in interface PotentialAgentPotentialAgent.createAgent(org.volante.abm.data.Region,
org.volante.abm.data.Cell[])public String getID()
getID in interface PotentialAgentpublic int getSerialID()
getSerialID in interface PotentialAgentpublic double getGivingUp()
getGivingUp in interface PotentialAgentpublic double getGivingIn()
getGivingIn in interface PotentialAgentpublic void initialise(ModelData data, RunInfo info, Region r) throws Exception
initialise in interface Initialisabledata - model datainfo - run informationr - region the initialisable object belongs toExceptionpublic ProductionModel getProduction()
productionModelChanged() is mandatory!
TODO make ProductionModel immutablegetProduction in interface PotentialAgentPotentialAgent.getProduction()public void productionModelChanged()
public void registerPotentialAgentProductionObserver(PotentialAgentProductionObserver observer)
registerPotentialAgentProductionObserver in interface PotentialAgentpublic void removePotentialAgentProductionObserver(PotentialAgentProductionObserver observer)
removePotentialAgentProductionObserver in interface PotentialAgent