edu.ou.mlfw.config
Class WorldConfig
java.lang.Object
edu.ou.mlfw.config.WorldConfig
public class WorldConfig
- extends java.lang.Object
A WorldConfiguration points to the file location of a SimulatorInitializer
and provides mapping entries from uniquely named controllables to the
clients that will control them.
Constructor Summary |
WorldConfig(java.lang.Class<? extends Simulator> simulatorClass,
java.io.File simulatorConfig,
ClientMapping[] mappingInformation)
Constructor for a WorldConfig. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WorldConfig
public WorldConfig(java.lang.Class<? extends Simulator> simulatorClass,
java.io.File simulatorConfig,
ClientMapping[] mappingInformation)
- Constructor for a WorldConfig.
- Parameters:
simulatorConfigurationFile
- File location for the simulator
configuration.mappingInformation
- A set of mappings between the names of the
controllables that should be provided by the simulator, and the
ClientInitializers for the clients that will control them.
getMappingInformation
public ClientMapping[] getMappingInformation()
- Returns:
- The mappings from controllable names to ClientInitializers.
getSimulatorConfig
public java.io.File getSimulatorConfig()
- Returns:
- The file location of the SimulatorInitializer.
getGuiDelay
public long getGuiDelay()
getSimulatorClass
public java.lang.Class<? extends Simulator> getSimulatorClass()
getXStream
public static com.thoughtworks.xstream.XStream getXStream()
- Returns:
- An XStream object properly initialized for serializing and
deserializing a WorldConfig object.
fromXMLFile
public static WorldConfig fromXMLFile(java.io.File f)
throws java.io.IOException
- Factory method to generate a WorldConfig from the given file.
This uses Xstream to deserialize an XML representation of the
WorldConfig object; additional documentation on the required
format for this file can be found in the example WorldConfig
file included in the samples distribution.
- Parameters:
f
- The file to deserialize.
- Returns:
- The deserialized WorldConfig
- Throws:
java.io.IOException