public class DefaultAgent extends AbstractAgent
| Modifier and Type | Field and Description |
|---|---|
protected double |
givingIn |
protected double |
givingUp |
protected ProductionModel |
production |
protected PotentialAgent |
type |
cells, currentCompetitiveness, id, productivity, regionNOT_MANAGED, NOT_MANAGED_COMPETITION, NOT_MANAGED_ID| Constructor and Description |
|---|
DefaultAgent() |
DefaultAgent(PotentialAgent type,
ModelData data,
Region r,
ProductionModel prod,
double givingUp,
double givingIn) |
DefaultAgent(PotentialAgent type,
String id,
ModelData data,
Region r,
ProductionModel prod,
double givingUp,
double givingIn) |
DefaultAgent(String id,
ModelData data) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canTakeOver(Cell c,
double incoming)
Return true if this agent is happy to cede to an agent with the given
level of competitiveness
|
void |
considerGivingUp()
Asks this agent if it wants to give up
|
double |
getGivingIn() |
double |
getGivingUp() |
ProductionModel |
getProductionFunction() |
ProductionModel |
getProductionModel()
Returns the production model of this agent.
|
PotentialAgent |
getType() |
String |
infoString()
Returns useful descriptive information about this agent
|
void |
receiveNotification(de.cesr.more.basic.agent.MoreObservingNetworkAgent.NetworkObservation observation,
Agent object) |
void |
setGivingIn(double g) |
void |
setGivingUp(double g) |
void |
setProductionFunction(ProductionModel f) |
com.moseph.modelutils.fastdata.UnmodifiableNumberMap<Service> |
supply(Cell c)
Returns what this agent could supply on the given cell
|
void |
updateSupply()
Recalculates the services this agent can supply
|
addCell, die, getAge, getCells, getCompetitiveness, getHomeCell, getID, getRegion, giveUp, removeCell, setAge, setId, setRegion, tickEndUpdate, tickStartUpdate, toRemove, toString, updateCompetitivenessprotected ProductionModel production
protected double givingUp
protected double givingIn
protected PotentialAgent type
public DefaultAgent()
public DefaultAgent(PotentialAgent type, ModelData data, Region r, ProductionModel prod, double givingUp, double givingIn)
public DefaultAgent(PotentialAgent type, String id, ModelData data, Region r, ProductionModel prod, double givingUp, double givingIn)
public void updateSupply()
Agentpublic ProductionModel getProductionModel()
AgentAgent.getProductionModel()public void considerGivingUp()
Agentpublic boolean canTakeOver(Cell c, double incoming)
Agentpublic com.moseph.modelutils.fastdata.UnmodifiableNumberMap<Service> supply(Cell c)
Agentpublic void setProductionFunction(ProductionModel f)
public ProductionModel getProductionFunction()
public void setGivingUp(double g)
public void setGivingIn(double g)
public double getGivingUp()
public double getGivingIn()
public PotentialAgent getType()
public String infoString()
Agentpublic void receiveNotification(de.cesr.more.basic.agent.MoreObservingNetworkAgent.NetworkObservation observation,
Agent object)