org.mars_sim.msp.simulation
Class SimulationConfig

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

public class SimulationConfig
extends java.lang.Object
implements java.io.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.
 CropConfig getCropConfiguration()
          Gets the crop config subset.
 java.lang.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.
 java.lang.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 getPartConfig()
          Gets the part config subset.
 PartPackageConfig getPartPackageConfig()
          Gets the part package configuration.
 PersonConfig getPersonConfiguration()
          Gets the person config subset.
 AmountResourceConfig getResourceConfig()
          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 reloadConfig()
          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.

reloadConfig

public static void reloadConfig()
                         throws java.lang.Exception
Reloads all of the configuration files.

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

getSimulationTimeRatio

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

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

getEarthStartDateTime

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

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

getMarsStartDateTime

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

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

getPartConfig

public PartConfig getPartConfig()
Gets the part config subset.

Returns:
part config

getPartPackageConfig

public PartPackageConfig getPartPackageConfig()
Gets the part package configuration.

Returns:
part package config

getResourceConfig

public AmountResourceConfig getResourceConfig()
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