|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmas.agentsHempelsSofa.data.AgentToken
public class AgentToken
An implementation of an agent token which includes the following information about an agent:
Graph
.
Field Summary | |
---|---|
static int |
STRATEGY_ATTACKER
Says that the agent takes part in an attack. |
static int |
STRATEGY_EXPLORER
Says that the agent takes part in an exploration. |
static int |
STRATEGY_UNKNOWN
The state is unknown (enemy tokens). |
static int |
STRATEGY_ZONE_BUILDER
Says that the agent takes part in building a zone. |
Constructor Summary | |
---|---|
AgentToken(java.lang.String name,
java.lang.String team,
Vertex position,
java.lang.String state,
int step)
Constructor which sets name , team , position and
state . |
|
AgentToken(java.lang.String name,
java.lang.String team,
Vertex position,
java.lang.String state,
java.lang.String role,
int energy,
int health,
int strength,
int visibilityRange,
int step)
The constructor for an inspection. |
|
AgentToken(java.lang.String name,
java.lang.String team,
Vertex position,
Vertex targetVertex,
java.lang.String state,
java.lang.String role,
int energy,
int maxEnergy,
int maxEnergyDisabled,
int health,
int maxHealth,
int strength,
int visibilityRange,
int step)
The complete constructor (for agents of same team). |
|
AgentToken(java.lang.String name,
java.lang.String team,
Vertex position,
Vertex targetVertex,
java.lang.String state,
java.lang.String role,
int energy,
int maxEnergy,
int maxEnergyDisabled,
int health,
int maxHealth,
int strength,
int visibilityRange,
int lastUpdate,
int lastInspection)
The complete constructor (for agents of same team). |
Method Summary | |
---|---|
int |
compareTo(AgentToken t)
|
boolean |
equals(java.lang.Object obj)
|
int |
getEnergy()
|
int |
getHealth()
|
int |
getLastInspection()
|
java.lang.String |
getLaststate()
|
int |
getLastUpdate()
|
int |
getMaxEnergy()
|
int |
getMaxEnergyDisabled()
|
int |
getMaxHealth()
|
java.lang.String |
getName()
|
Vertex |
getNextPosition()
|
Vertex |
getPosition()
|
java.lang.String |
getRole()
|
java.lang.String |
getState()
|
int |
getStrategyType()
|
java.lang.String |
getStrategyTypeString()
|
int |
getStrength()
|
AgentToken |
getTargetAgent()
|
Vertex |
getTargetVertex()
|
java.lang.String |
getTeam()
|
int |
getVisibilityRange()
|
void |
inspection(java.lang.String role,
int energy,
int health,
int strength,
int visibilityRange,
int step)
|
boolean |
isAttacker()
|
boolean |
isDisabled()
|
boolean |
isOfTeam(java.lang.String team)
|
boolean |
isStrategyKnown()
|
boolean |
isZoneBuilder()
|
void |
setEnergy(int energy)
|
void |
setHealth(int health)
|
void |
setLastInspection(int lastInspected)
|
void |
setLaststate(java.lang.String laststate)
|
void |
setLastUpdate(int lastUpdate)
|
void |
setMaxEnergy(int maxEnergy)
|
void |
setMaxEnergyDisabled(int maxEnergyDisabled)
|
void |
setMaxHealth(int maxHealth)
|
void |
setName(java.lang.String name)
Sets the name of an agent token |
void |
setNextPosition(Vertex nextPosition)
|
void |
setPosition(Vertex position)
|
void |
setRole(java.lang.String role)
|
void |
setState(java.lang.String state)
|
void |
setStrategyType(int strategyType)
|
void |
setStrength(int strength)
|
void |
setTargetAgent(AgentToken targetAgent)
|
void |
setTargetVertex(Vertex targetVertex)
|
void |
setTeam(java.lang.String team)
|
void |
setVisibilityRange(int visibilityRange)
|
boolean |
stateChanged()
|
apltk.interpreter.data.LogicBelief |
toBelief()
|
java.lang.String |
toString()
|
void |
update(Vertex position,
java.lang.String state,
int step)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STRATEGY_ZONE_BUILDER
public static final int STRATEGY_ATTACKER
public static final int STRATEGY_EXPLORER
public static final int STRATEGY_UNKNOWN
Constructor Detail |
---|
public AgentToken(java.lang.String name, java.lang.String team, Vertex position, java.lang.String state, java.lang.String role, int energy, int health, int strength, int visibilityRange, int step)
name
- the name of the agentteam
- the team of the agentposition
- the position of the agentstate
- the current state of the agentrole
- the role of the agentenergy
- the current energy of the agenthealth
- the current health of the agentstrength
- the strength of the agentvisibilityRange
- the visibility range of the agentstep
- the number of the actually executed steppublic AgentToken(java.lang.String name, java.lang.String team, Vertex position, Vertex targetVertex, java.lang.String state, java.lang.String role, int energy, int maxEnergy, int maxEnergyDisabled, int health, int maxHealth, int strength, int visibilityRange, int step)
name
- the name of the agentteam
- the team of the agentposition
- the position of the agentstate
- the current state of the agentrole
- the role of the agentenergy
- the current energy of the agentmaxEnergy
- the maximum energy of the agentmaxEnergyDisabled
- the maximum energy of the agent if it is
disabledhealth
- the current health of the agentmaxHealth
- the maximum health of the agentstrength
- the strength of the agentvisibilityRange
- the visibility range of the agentstep
- the number of the actually executed steppublic AgentToken(java.lang.String name, java.lang.String team, Vertex position, Vertex targetVertex, java.lang.String state, java.lang.String role, int energy, int maxEnergy, int maxEnergyDisabled, int health, int maxHealth, int strength, int visibilityRange, int lastUpdate, int lastInspection)
name
- the name of the agentteam
- the team of the agentposition
- the position of the agentstate
- the current state of the agentrole
- the role of the agentenergy
- the current energy of the agentmaxEnergy
- the maximum energy of the agentmaxEnergyDisabled
- the maximum energy of the agent if it is
disabledhealth
- the current health of the agentmaxHealth
- the maximum health of the agentstrength
- the strength of the agentvisibilityRange
- the visibility range of the agentlastUpdate
- the step of the last updatelastInspection
- the step of the last inspectionpublic AgentToken(java.lang.String name, java.lang.String team, Vertex position, java.lang.String state, int step)
name
, team
, position
and
state
. The other values are set to null
or -1
.
name
- the name of the agentteam
- the team of the agentposition
- the Position of the agentstate
- the state of the agentstep
- the number of the actually executed stepMethod Detail |
---|
public void setName(java.lang.String name)
name
- The new name of the agentpublic void update(Vertex position, java.lang.String state, int step)
public void inspection(java.lang.String role, int energy, int health, int strength, int visibilityRange, int step)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public void setRole(java.lang.String role)
role
- the role to setpublic java.lang.String getRole()
public void setTeam(java.lang.String team)
team
- the team to setpublic java.lang.String getTeam()
public void setPosition(Vertex position)
position
- the position to setpublic Vertex getPosition()
public void setState(java.lang.String state)
state
- the state to setpublic java.lang.String getState()
public void setEnergy(int energy)
energy
- the energy to setpublic int getEnergy()
public void setMaxEnergy(int maxEnergy)
maxEnergy
- the maxEnergy to setpublic int getMaxEnergy()
public void setMaxEnergyDisabled(int maxEnergyDisabled)
maxEnergyDisabled
- the maxEnergyDisabled to setpublic int getMaxEnergyDisabled()
public void setHealth(int health)
health
- the health to setpublic int getHealth()
public void setMaxHealth(int maxHealth)
maxHealth
- the maxHealth to setpublic int getMaxHealth()
public void setStrength(int strength)
strength
- the strength to setpublic int getStrength()
public void setVisibilityRange(int visibilityRange)
visibilityRange
- the visibilityRange to setpublic int getVisibilityRange()
public void setLastInspection(int lastInspected)
lastInspected
- the lastInspected to setpublic int getLastInspection()
public void setTargetVertex(Vertex targetVertex)
targetVertex
- the tar))getVertex to setpublic Vertex getTargetVertex()
public void setLastUpdate(int lastUpdate)
lastUpdate
- the lastUpdate to setpublic int getLastUpdate()
public boolean isOfTeam(java.lang.String team)
team
- the team which shall be checked
true
- if the agent is in the team,false
- otherwise.public apltk.interpreter.data.LogicBelief toBelief()
toBelief
in interface Believable
public void setTargetAgent(AgentToken targetAgent)
targetAgent
- the targetAgent to setpublic AgentToken getTargetAgent()
public void setNextPosition(Vertex nextPosition)
nextPosition
- the nextPosition to setpublic Vertex getNextPosition()
public boolean isDisabled()
public int compareTo(AgentToken t)
compareTo
in interface java.lang.Comparable<AgentToken>
public void setLaststate(java.lang.String laststate)
laststate
- the laststate to setpublic java.lang.String getLaststate()
public boolean stateChanged()
public void setStrategyType(int strategyType)
strategyType
- the zoneBuildingState to setpublic int getStrategyType()
public boolean isZoneBuilder()
public boolean isAttacker()
public boolean isStrategyKnown()
public java.lang.String getStrategyTypeString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |