public class GraphSimulationWorldState extends SimulationWorldState implements WorldState
Modifier and Type | Field and Description |
---|---|
protected Map<String,GraphSimulationAgentState> |
agentNamesMap
A map from an agent's name to its current state.
|
protected Vector<GraphSimulationAgentState> |
agents
A vector holding all agents that take part in the simulation.
|
protected GraphSimulationConfiguration |
config
The configuration of this simulation.
|
protected Map<GraphNode,List<GraphEdge>> |
connectedEdgesMap
A map holding the list of edges connected to each node.
|
protected Vector<GraphEdge> |
edges
The edges conforming the map graph.
|
protected Map<GraphNode,List<GraphNode>> |
neighborsMap
A map holding the list of nodes directly connected to each node.
|
protected Map<String,GraphNode> |
nodeNamesMap
A map from a node's name to its current state.
|
protected Vector<GraphNode> |
nodes
The nodes conforming the map graph.
|
protected int |
sizeX
The width of the abstract grid to which the graph is subscribed.
|
protected int |
sizeY
The height of the abstract grid to which the graph is subscribed.
|
Vector<TeamState> |
teamsStates
A vector holding the states of all the teams that take part in the
simulation.
|
actionSuccessProbability, currentStep, informationDistortionProbability, maxNumberOfSteps, numberOfAgents, numberOfObstacles, numberOfSteps, outputFolder, simulationName, sizex, sizey, teamName, teamScore, tournamentName
Constructor and Description |
---|
GraphSimulationWorldState(GraphSimulationConfiguration config)
Creates a simulation state as defined by
config |
Modifier and Type | Method and Description |
---|---|
void |
addAgent(GraphSimulationAgentState agent,
Vector<Integer> agentPositions,
boolean newPosition)
Adds
agent to the currently simulation, and situates it in a
random node in the map. |
GraphSimulationAgentState |
getAgent(String agentName)
Returns the state of an agent given its name.
|
Vector<GraphSimulationAgentState> |
getAgents()
getter for the vector holding all agents that take part in the
simulation.
|
GraphSimulationConfiguration |
getConfig()
getter for the configuration object.
|
List<GraphEdge> |
getConnectedEdges(GraphNode node)
Returns the list of the edges connected to
node |
List<GraphNode> |
getNeighborNodes(GraphNode node)
Returns the list of the nodes directly connected to
node |
GraphNode |
getNode(String nodeName)
Returns the node object representation given its name.
|
Collection<GraphNode> |
getNodes()
getter for the vector holding all nodes of the map.
|
String |
getTeamName(int number)
Provides a numeric representation of the team name, null if the number
does not correspond to any team.
|
int |
getTeamNr(String name)
Returns a numeric representation of the team name, -1 if the team has not
been added to the teams list of the simulation.
|
TeamState |
getTeamState(String name)
Returns the state of team given its name.
|
protected void |
populateMapsCahes()
Initialize the maps used as cache for faster data access.
|
void |
setAgents(Vector<GraphSimulationAgentState> agents)
setter for the vector holding all agents that take part in the
simulation.
|
protected Map<GraphNode,List<GraphNode>> neighborsMap
protected Map<GraphNode,List<GraphEdge>> connectedEdgesMap
protected Map<String,GraphSimulationAgentState> agentNamesMap
protected Map<String,GraphNode> nodeNamesMap
protected Vector<GraphSimulationAgentState> agents
protected GraphSimulationConfiguration config
public Vector<TeamState> teamsStates
protected int sizeX
protected int sizeY
public GraphSimulationWorldState(GraphSimulationConfiguration config)
config
config
- protected void populateMapsCahes()
public Vector<GraphSimulationAgentState> getAgents()
public void setAgents(Vector<GraphSimulationAgentState> agents)
agents
- public GraphSimulationConfiguration getConfig()
public GraphSimulationAgentState getAgent(String agentName)
agentName
- public GraphNode getNode(String nodeName)
nodeName
- public List<GraphNode> getNeighborNodes(GraphNode node)
node
node
- public List<GraphEdge> getConnectedEdges(GraphNode node)
node
node
- public Collection<GraphNode> getNodes()
public void addAgent(GraphSimulationAgentState agent, Vector<Integer> agentPositions, boolean newPosition)
agent
to the currently simulation, and situates it in a
random node in the map.agent
- public int getTeamNr(String name)
name
- public String getTeamName(int number)
name
- Copyright © 2013. All Rights Reserved.