massim.competition2011
Class GraphSimulationAgentPerception

java.lang.Object
  extended by massim.competition2011.GraphSimulationAgentPerception
All Implemented Interfaces:
java.io.Serializable, Perception, XMLCodec.XMLEncodable

public class GraphSimulationAgentPerception
extends java.lang.Object
implements Perception, XMLCodec.XMLEncodable

This class holds the information that will be sent to an agent as a normal perception.

See Also:
Serialized Form

Field Summary
 java.util.Set<GraphSimulationAgentState> agents
          The set of agent that are currently visible to the agent
 java.util.Set<GraphEdge> edges
          The set of edges that are currently visible to the agent
 java.util.Set<GraphSimulationAgentState> inspectedAgents
          The set of agents that where inspected in the previous step, for which the agent owner of this perception should get extended information.
 java.util.Set<GraphNode> nodes
          The set of nodes that are currently visible to the agent
 java.util.Set<GraphNode> probedNodes
          The set of nodes that where probed in the previous step, for which the agent owner of this perception should get extended information.
 GraphSimulationAgentState self
          The state of the agent to which this perception belongs.
 int step
          The current simulation step
 java.util.Set<GraphEdge> surveyedEdges
          The set of edges that where surveyed in the previous step, for which the agent owner of this perception should get extended information.
 TeamState team
          The state of the team of the agent owner of this perception.
 
Constructor Summary
GraphSimulationAgentPerception()
          Constructs for an empty perception.
 
Method Summary
 void addSharedPercept(GraphSimulationAgentPerception sharedPer)
          Adds all the perceived elements of sharedPer to the perceived elements of this perception.
 void encodeToXML(org.w3c.dom.Element target)
          Encodes the contents of this perception object in the right XML format, in concordance to the protocol description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

self

public GraphSimulationAgentState self
The state of the agent to which this perception belongs.


team

public TeamState team
The state of the team of the agent owner of this perception.


nodes

public java.util.Set<GraphNode> nodes
The set of nodes that are currently visible to the agent


edges

public java.util.Set<GraphEdge> edges
The set of edges that are currently visible to the agent


agents

public java.util.Set<GraphSimulationAgentState> agents
The set of agent that are currently visible to the agent


probedNodes

public java.util.Set<GraphNode> probedNodes
The set of nodes that where probed in the previous step, for which the agent owner of this perception should get extended information.


surveyedEdges

public java.util.Set<GraphEdge> surveyedEdges
The set of edges that where surveyed in the previous step, for which the agent owner of this perception should get extended information.


inspectedAgents

public java.util.Set<GraphSimulationAgentState> inspectedAgents
The set of agents that where inspected in the previous step, for which the agent owner of this perception should get extended information.


step

public int step
The current simulation step

Constructor Detail

GraphSimulationAgentPerception

public GraphSimulationAgentPerception()
Constructs for an empty perception.

Method Detail

encodeToXML

public void encodeToXML(org.w3c.dom.Element target)
Encodes the contents of this perception object in the right XML format, in concordance to the protocol description.

Specified by:
encodeToXML in interface XMLCodec.XMLEncodable

addSharedPercept

public void addSharedPercept(GraphSimulationAgentPerception sharedPer)
Adds all the perceived elements of sharedPer to the perceived elements of this perception.

The main purpose of this method is to facilitate the management of shared perceptions: First, an empty perception object is created, and this method is called on it repeatedly to add private perceptions that are to be shared.
Then, this method is called on the private perception objects, passing the now populated shared perceptions object.

Parameters:
sharedPer -


Copyright © 2011. All Rights Reserved.