org.mars_sim.msp.core
Class SimulationConfig

java.lang.Object
  extended by org.mars_sim.msp.core.SimulationConfig
All Implemented Interfaces:
Serializable

public class SimulationConfig
extends Object
implements Serializable

Loads the simulation configuration XML files as DOM documents. Provides simulation configuration. Provides access to other simulation subset configuration classes.

See Also:
Serialized Form

Method Summary
 BuildingConfig getBuildingConfiguration()
          Gets the building config subset.
 ConstructionConfig getConstructionConfiguration()
          Gets the construction config subset.
 CropConfig getCropConfiguration()
          Gets the crop config subset.
 String getEarthStartDateTime()
          Gets the Earth date/time for when the simulation starts.
 LandmarkConfig getLandmarkConfiguration()
          Gets the landmark config subset.
 MalfunctionConfig getMalfunctionConfiguration()
          Gets the malfunction config subset.
 ManufactureConfig getManufactureConfiguration()
          Gets the manufacture config subset.
 String getMarsStartDateTime()
          Gets the Mars dat/time for when the simulation starts.
 MedicalConfig getMedicalConfiguration()
          Gets the medical config subset.
 MineralMapConfig getMineralMapConfiguration()
          Gets the mineral map config subset.
 PartConfig getPartConfiguration()
          Gets the part config subset.
 PartPackageConfig getPartPackageConfiguration()
          Gets the part package configuration.
 PersonConfig getPersonConfiguration()
          Gets the person config subset.
 AmountResourceConfig getResourceConfiguration()
          Gets the resource config subset.
 ResupplyConfig getResupplyConfiguration()
          Gets the resupply configuration.
 SettlementConfig getSettlementConfiguration()
          Gets the settlement config subset.
 double getSimulationTimeRatio()
          Gets the simulation time to real time ratio.
 VehicleConfig getVehicleConfiguration()
          Gets the vehicle config subset.
static SimulationConfig instance()
          Gets a singleton instance of the simulation config.
static void loadConfig()
          Reloads all of the configuration files.
static void setInstance(SimulationConfig instance)
          Sets the singleton instance .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static SimulationConfig instance()
Gets a singleton instance of the simulation config.

Returns:
SimulationConfig instance

setInstance

public static void setInstance(SimulationConfig instance)
Sets the singleton instance .

Parameters:
instance - the singleton instance.

loadConfig

public static void loadConfig()
Reloads all of the configuration files.

Throws:
Exception - if error loading or parsing configuration files.

getSimulationTimeRatio

public double getSimulationTimeRatio()
Gets the simulation time to real time ratio. Example: 100.0 mean 100 simulation seconds per 1 real second.

Returns:
ratio
Throws:
Exception - if ratio is not in configuration or is not valid.

getEarthStartDateTime

public String getEarthStartDateTime()
Gets the Earth date/time for when the simulation starts.

Returns:
date/time as string in "MM/dd/yyyy hh:mm:ss" format.
Throws:
Exception - if value is null or empty.

getMarsStartDateTime

public String getMarsStartDateTime()
Gets the Mars dat/time for when the simulation starts.

Returns:
date/time as string in "orbit-month-sol:millisol" format.
Throws:
Exception - if value is null or empty.

getPartConfiguration

public PartConfig getPartConfiguration()
Gets the part config subset.

Returns:
part config

getPartPackageConfiguration

public PartPackageConfig getPartPackageConfiguration()
Gets the part package configuration.

Returns:
part package config

getResourceConfiguration

public AmountResourceConfig getResourceConfiguration()
Gets the resource config subset.

Returns:
resource config

getPersonConfiguration

public PersonConfig getPersonConfiguration()
Gets the person config subset.

Returns:
person config

getMedicalConfiguration

public MedicalConfig getMedicalConfiguration()
Gets the medical config subset.

Returns:
medical config

getLandmarkConfiguration

public LandmarkConfig getLandmarkConfiguration()
Gets the landmark config subset.

Returns:
landmark config

getMineralMapConfiguration

public MineralMapConfig getMineralMapConfiguration()
Gets the mineral map config subset.

Returns:
mineral map config

getMalfunctionConfiguration

public MalfunctionConfig getMalfunctionConfiguration()
Gets the malfunction config subset.

Returns:
malfunction config

getCropConfiguration

public CropConfig getCropConfiguration()
Gets the crop config subset.

Returns:
crop config

getVehicleConfiguration

public VehicleConfig getVehicleConfiguration()
Gets the vehicle config subset.

Returns:
vehicle config

getBuildingConfiguration

public BuildingConfig getBuildingConfiguration()
Gets the building config subset.

Returns:
building config

getResupplyConfiguration

public ResupplyConfig getResupplyConfiguration()
Gets the resupply configuration.

Returns:
resupply config

getSettlementConfiguration

public SettlementConfig getSettlementConfiguration()
Gets the settlement config subset.

Returns:
settlement config

getManufactureConfiguration

public ManufactureConfig getManufactureConfiguration()
Gets the manufacture config subset.

Returns:
manufacture config

getConstructionConfiguration

public ConstructionConfig getConstructionConfiguration()
Gets the construction config subset.

Returns:
construction config


Copyright © 2009-2013. All Rights Reserved.