massim.competition2011.scenario
Class TeamState

java.lang.Object
  extended by massim.competition2011.scenario.TeamState
All Implemented Interfaces:
java.io.Serializable

public class TeamState
extends java.lang.Object
implements java.io.Serializable

This class holds information about the current state of a Team, including current score, zones built, achievement points, achievements, etc.

See Also:
Serialized Form

Field Summary
static int ACHIEVEMENT_PONITS_SCALE
           
 java.util.Vector<Achievement> achievements
           
 java.util.List<DominatedArea> areas
           
 long currAchievementPoints
           
 java.lang.String name
           
 java.util.Vector<Achievement> newAchievements
           
 int ranking
           
 long summedScore
           
 int teamIdx
           
 long usedAchievementPoints
           
 
Constructor Summary
TeamState(java.lang.String name, int teamIdx)
           
 
Method Summary
 boolean addInspectedAgent(GraphSimulationAgentState agent)
           
 boolean addInspectedAgent(java.lang.String agentName)
           
 boolean addProbedNodes(GraphNode node)
           
 boolean addProbedNodes(java.lang.String nodeName)
           
 boolean addSurveyedEdge(GraphEdge e)
           
 void calculateNewAchievements()
          Checks if the teams has reached new achievements, marks them as reached, and increases the current achievementPoints accordingly.
 java.util.Vector<java.lang.String> getAchieved()
          Returns a vector with the name of the achievements that the team obtained during the whole simulation.
 long getAreasValue()
          Returns the summed score of all the dominated areas.
 long getAreaValue(DominatedArea area)
          Returns the value of the area given as parameter.
 long getAreaValue(GraphSimulationAgentState agent)
          Returns the value of the dominated area of which the agent given as parameter is part.
 long getCurrent()
          Returns the current step-score (that is, the score that depends only on the current status of the world, and that should be added to the total team score in every step).
 java.util.Vector<java.lang.String> getNewlyAchieved()
          Returns a vector with the name of the achievements that the team obtained during the last simulation step.
 java.util.Set<java.lang.String> getProbedNodes()
           
 void initAchievements(java.util.Vector<Achievement> configAchievements)
           
 void succsefullAttack()
           
 void succsefullParry()
           
 void sumCurrent()
          Sums the step score to the total score.
 boolean useAchievementPoints(long points)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACHIEVEMENT_PONITS_SCALE

public static final int ACHIEVEMENT_PONITS_SCALE
See Also:
Constant Field Values

name

public java.lang.String name

teamIdx

public int teamIdx

ranking

public int ranking

summedScore

public long summedScore

currAchievementPoints

public long currAchievementPoints

usedAchievementPoints

public long usedAchievementPoints

areas

public java.util.List<DominatedArea> areas

achievements

public java.util.Vector<Achievement> achievements

newAchievements

public java.util.Vector<Achievement> newAchievements
Constructor Detail

TeamState

public TeamState(java.lang.String name,
                 int teamIdx)
Method Detail

sumCurrent

public void sumCurrent()
Sums the step score to the total score. This method should be called once at the end of every simulation step.


getCurrent

public long getCurrent()
Returns the current step-score (that is, the score that depends only on the current status of the world, and that should be added to the total team score in every step).

Returns:

getAreasValue

public long getAreasValue()
Returns the summed score of all the dominated areas.

Returns:

getAreaValue

public long getAreaValue(DominatedArea area)
Returns the value of the area given as parameter.

Parameters:
area -
Returns:

getAreaValue

public long getAreaValue(GraphSimulationAgentState agent)
Returns the value of the dominated area of which the agent given as parameter is part. (returns 0 if the agent is not dominating area)

Parameters:
agent -
Returns:

useAchievementPoints

public boolean useAchievementPoints(long points)

calculateNewAchievements

public void calculateNewAchievements()
Checks if the teams has reached new achievements, marks them as reached, and increases the current achievementPoints accordingly.


getAchieved

public java.util.Vector<java.lang.String> getAchieved()
Returns a vector with the name of the achievements that the team obtained during the whole simulation.

Returns:
a Vector<String> containing the names.

getNewlyAchieved

public java.util.Vector<java.lang.String> getNewlyAchieved()
Returns a vector with the name of the achievements that the team obtained during the last simulation step.

Returns:
a Vector<String> containing the names.

succsefullAttack

public void succsefullAttack()

succsefullParry

public void succsefullParry()

addSurveyedEdge

public boolean addSurveyedEdge(GraphEdge e)

addProbedNodes

public boolean addProbedNodes(java.lang.String nodeName)

addInspectedAgent

public boolean addInspectedAgent(java.lang.String agentName)

addProbedNodes

public boolean addProbedNodes(GraphNode node)

getProbedNodes

public java.util.Set<java.lang.String> getProbedNodes()

addInspectedAgent

public boolean addInspectedAgent(GraphSimulationAgentState agent)

initAchievements

public void initAchievements(java.util.Vector<Achievement> configAchievements)


Copyright © 2011. All Rights Reserved.