massim.competition2011
Class GraphSimulationConfiguration

java.lang.Object
  extended by massim.framework.simulation.DefaultSimpleSimulationConfiguration
      extended by massim.competition2011.GraphSimulationConfiguration
All Implemented Interfaces:
java.io.Serializable, SimpleSimulationConfiguration, SimulationConfiguration, XMLCodec.XMLDecodable, ServerSimulationConfiguration

public class GraphSimulationConfiguration
extends DefaultSimpleSimulationConfiguration
implements java.io.Serializable, ServerSimulationConfiguration, XMLCodec.XMLDecodable

This class holds the simulation configuration specified in the XML config file.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface massim.framework.simulation.SimpleSimulationConfiguration
SimpleSimulationConfiguration.AgentConfiguration
 
Field Summary
 java.util.Vector<Achievement> achievements
          A vector holding the configurations of every possible achievement.
 java.util.HashMap<java.lang.String,ActionConfiguration> actionsConfMap
          A map from action names to their configurations.
 int agentsPerTeam
          The number of agents taking part in each team.
 int cellWidth
          The width of each grid cell in the abstract grid in which the graph nodes will be randomly placed when generating the graph.
 int gridHeight
          The height of the abstract grid in which the graph nodes will be randomly placed when generating the graph.
 int gridWidth
          The width of the abstract grid in which the graph nodes will be randomly placed when generating the graph.
 java.lang.String mapGenerator
          The type of generator to be used
 int maxEdgeCost
          Maximum possible value for the random assignment of costs to edges during map generation.
 int maxNodeWeight
          Maximum possible value for the random assignment of weights to nodes during map generation.
 int maxNumberOfSteps
          The max number of steps that this simulation should run if not finalized or interrupted before.
 int minEdgeCost
          Minimum possible value for the random assignment of costs to edges during map generation.
 int minNodeWeight
          Minimum possible value for the random assignment of weights to nodes during map generation.
 int nodeWeighting
          Factor for weighting the random and the gradient component of the nodeWeight. 100 means totally random, 0 means a fully gradient weight.
 int numberOfAgents
          The number of agents taking part in the simulation.
 int numberOfNodes
          The number of nodes for the graph to generate.
 int numberOfTeams
          The number of teams taking part in the simulation.
 long randomSeed
          The seed that will be used for the random graph generator
 java.util.HashMap<java.lang.String,RoleConfiguration> rolesConfMap
          A map from role names to their configurations.
 java.lang.String simulationName
          Simulation's name.
 java.lang.String tournamentName
          Tournament's name.
 
Constructor Summary
GraphSimulationConfiguration()
           
 
Method Summary
 void decodeFromXML(org.w3c.dom.Element source)
          Populates this object from the contents of an XML subtree with its root in source (taken from the configuration file).
 ActionConfiguration getActionConf(java.lang.String name)
          Returns the configuration object of the action whose name is given as a parameter.
 RoleConfiguration getRoleConf(java.lang.String name)
          Returns the configuration object of the role whose name is given as a parameter.
 java.util.Vector<java.lang.String> getTeamNames()
           
 void setSimulationName(java.lang.String name)
           
 void setTeamName(int n, java.lang.String name)
           
 void setTournamentName(java.lang.String name)
           
 
Methods inherited from class massim.framework.simulation.DefaultSimpleSimulationConfiguration
getAgentConfigurations, setAgentConfigurations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tournamentName

public java.lang.String tournamentName
Tournament's name.


simulationName

public java.lang.String simulationName
Simulation's name.


maxNumberOfSteps

public int maxNumberOfSteps
The max number of steps that this simulation should run if not finalized or interrupted before.


numberOfAgents

public int numberOfAgents
The number of agents taking part in the simulation.


numberOfTeams

public int numberOfTeams
The number of teams taking part in the simulation.


agentsPerTeam

public int agentsPerTeam
The number of agents taking part in each team.


numberOfNodes

public int numberOfNodes
The number of nodes for the graph to generate.


gridWidth

public int gridWidth
The width of the abstract grid in which the graph nodes will be randomly placed when generating the graph.


gridHeight

public int gridHeight
The height of the abstract grid in which the graph nodes will be randomly placed when generating the graph.


cellWidth

public int cellWidth
The width of each grid cell in the abstract grid in which the graph nodes will be randomly placed when generating the graph. Used for visualization.


minNodeWeight

public int minNodeWeight
Minimum possible value for the random assignment of weights to nodes during map generation.


maxNodeWeight

public int maxNodeWeight
Maximum possible value for the random assignment of weights to nodes during map generation.


nodeWeighting

public int nodeWeighting
Factor for weighting the random and the gradient component of the nodeWeight. 100 means totally random, 0 means a fully gradient weight.


minEdgeCost

public int minEdgeCost
Minimum possible value for the random assignment of costs to edges during map generation.


maxEdgeCost

public int maxEdgeCost
Maximum possible value for the random assignment of costs to edges during map generation.


actionsConfMap

public java.util.HashMap<java.lang.String,ActionConfiguration> actionsConfMap
A map from action names to their configurations.


rolesConfMap

public java.util.HashMap<java.lang.String,RoleConfiguration> rolesConfMap
A map from role names to their configurations.


achievements

public java.util.Vector<Achievement> achievements
A vector holding the configurations of every possible achievement.


randomSeed

public long randomSeed
The seed that will be used for the random graph generator


mapGenerator

public java.lang.String mapGenerator
The type of generator to be used

Constructor Detail

GraphSimulationConfiguration

public GraphSimulationConfiguration()
Method Detail

setSimulationName

public void setSimulationName(java.lang.String name)
Specified by:
setSimulationName in interface ServerSimulationConfiguration

setTournamentName

public void setTournamentName(java.lang.String name)
Specified by:
setTournamentName in interface ServerSimulationConfiguration

setTeamName

public void setTeamName(int n,
                        java.lang.String name)
Specified by:
setTeamName in interface ServerSimulationConfiguration

getTeamNames

public java.util.Vector<java.lang.String> getTeamNames()

getActionConf

public ActionConfiguration getActionConf(java.lang.String name)
Returns the configuration object of the action whose name is given as a parameter.

Parameters:
name - The name of the action.
Returns:
an ActionConfiguration object.

getRoleConf

public RoleConfiguration getRoleConf(java.lang.String name)
Returns the configuration object of the role whose name is given as a parameter.

Parameters:
name - The name of the role.
Returns:
a RoleConfiguration object.

decodeFromXML

public void decodeFromXML(org.w3c.dom.Element source)
Populates this object from the contents of an XML subtree with its root in source (taken from the configuration file).

Specified by:
decodeFromXML in interface XMLCodec.XMLDecodable
Parameters:
source -


Copyright © 2011. All Rights Reserved.