massim.competition2011.scenario
Class DominatedArea

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

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

This class holds information about a Dominated Area, i.e. a connected part of the graph that belongs to a team according to the DominationCalculator.

See Also:
Serialized Form

Field Summary
 java.util.Collection<GraphSimulationAgentState> agents
           
 java.util.Collection<GraphNode> nodes
           
 int size
           
 java.lang.String team
           
 int totalScore
           
 
Constructor Summary
DominatedArea(java.lang.String team, java.util.Collection<GraphSimulationAgentState> agents, java.util.Collection<GraphNode> nodes, int size, int score)
           
 
Method Summary
 int calculateProbedScore(java.util.Collection<java.lang.String> probedNodes)
          Returns the score of the area, summing the full weight of each node in the area that has been probed, and 1 for every node in the area that hasn't been probed yet.
 boolean cointainsAgent(GraphSimulationAgentState ag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

team

public java.lang.String team

size

public int size

totalScore

public int totalScore

agents

public java.util.Collection<GraphSimulationAgentState> agents

nodes

public java.util.Collection<GraphNode> nodes
Constructor Detail

DominatedArea

public DominatedArea(java.lang.String team,
                     java.util.Collection<GraphSimulationAgentState> agents,
                     java.util.Collection<GraphNode> nodes,
                     int size,
                     int score)
Parameters:
team -
agents -
nodes -
size -
score -
Method Detail

calculateProbedScore

public int calculateProbedScore(java.util.Collection<java.lang.String> probedNodes)
Returns the score of the area, summing the full weight of each node in the area that has been probed, and 1 for every node in the area that hasn't been probed yet.

Parameters:
probedNodes - The collection of nodes that the team has probed.
Returns:
The score of the area.

cointainsAgent

public boolean cointainsAgent(GraphSimulationAgentState ag)
Parameters:
ag -
Returns:
true iff the agent ag is on one of the nodes conforming the area.


Copyright © 2011. All Rights Reserved.