|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.Unit
org.mars_sim.msp.simulation.structure.Structure
org.mars_sim.msp.simulation.structure.Settlement
public class Settlement
The Settlement class represents a settlement unit on virtual Mars. It contains information related to the state of the settlement.
Field Summary | |
---|---|
static java.lang.String |
ADD_ASSOCIATED_PERSON_EVENT
|
protected BuildingManager |
buildingManager
|
protected GoodsManager |
goodsManager
|
protected PowerGrid |
powerGrid
|
static java.lang.String |
REMOVE_ASSOCIATED_PERSON_EVENT
|
protected ResupplyManager |
resupplyManager
|
Fields inherited from class org.mars_sim.msp.simulation.structure.Structure |
---|
malfunctionManager |
Fields inherited from class org.mars_sim.msp.simulation.Unit |
---|
CONTAINER_UNIT_EVENT, DESCRIPTION_EVENT, LOCATION_EVENT, MASS_EVENT, NAME_EVENT |
Constructor Summary | |
---|---|
protected |
Settlement(java.lang.String name,
Coordinates location)
Constructor for subclass extension. |
|
Settlement(java.lang.String name,
java.lang.String template,
Coordinates location)
Constructs a Settlement object at a given location |
Method Summary | |
---|---|
java.util.Collection<Person> |
getAffectedPeople()
Gets a collection of people affected by this entity. |
double |
getAirPressure()
Gets the air pressure of the life support system. |
double |
getAirPressureModifier()
Gets the air pressure modifier for this settlement. |
java.util.Collection<Person> |
getAllAssociatedPeople()
Gets all people associated with this settlement, even if they are out on missions. |
java.util.Collection<Vehicle> |
getAllAssociatedVehicles()
Gets all vehicles associated with this settlement, even if they are out on missions. |
Airlock |
getAvailableAirlock()
Gets an available airlock for the settlement. |
int |
getAvailablePopulationCapacity()
Gets the current available population capacity of the settlement |
BuildingManager |
getBuildingManager()
Gets the settlement's building manager. |
int |
getCurrentPopulationNum()
Gets the current population number of the settlement |
GoodsManager |
getGoodsManager()
Gets the settlement's goods manager. |
Person[] |
getInhabitantArray()
Gets an array of current inhabitants of the settlement |
java.util.Collection<Person> |
getInhabitants()
Gets a collection of the inhabitants of the settlement. |
int |
getLifeSupportCapacity()
Gets the number of people the life support can provide for. |
boolean |
getMissionCreationOverride()
Gets the mission creation override flag. |
double |
getOxygenFlowModifier()
Gets the oxygen flow modifier for this settlement. |
int |
getParkedVehicleNum()
Gets the number of vehicles parked at the settlement. |
java.util.Collection<Vehicle> |
getParkedVehicles()
Gets a collection of vehicles parked at the settlement. |
int |
getPopulationCapacity()
Gets the population capacity of the settlement |
PowerGrid |
getPowerGrid()
Gets the settlement's power grid. |
ResupplyManager |
getResupplyManager()
Gets the settlement's resupply manager. |
double |
getTemperature()
Gets the temperature of the life support system. |
double |
getTemperatureModifier()
Gets the temperature modifier for this settlement. |
java.lang.String |
getTemplate()
Gets the settlement template. |
double |
getWaterFlowModifier()
Gets the water flow modifier for this settlement. |
boolean |
lifeSupportCheck()
Returns true if life support is working properly and is not out of oxygen or water. |
double |
provideOxygen(double amountRequested)
Gets oxygen from system. |
double |
provideWater(double amountRequested)
Gets water from system. |
void |
setMissionCreationOverride(boolean missionCreationOverride)
Sets the mission creation override flag. |
void |
timePassing(double time)
Perform time-related processes |
Methods inherited from class org.mars_sim.msp.simulation.structure.Structure |
---|
getMalfunctionManager |
Methods inherited from class org.mars_sim.msp.simulation.Unit |
---|
addUnitListener, fireUnitUpdate, fireUnitUpdate, getBaseMass, getContainerUnit, getCoordinates, getDescription, getInventory, getMass, getName, getTopContainerUnit, getUnitManager, removeUnitListener, setBaseMass, setContainerUnit, setCoordinates, setDescription, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mars_sim.msp.simulation.malfunction.Malfunctionable |
---|
getInventory, getName |
Field Detail |
---|
public static final java.lang.String ADD_ASSOCIATED_PERSON_EVENT
public static final java.lang.String REMOVE_ASSOCIATED_PERSON_EVENT
protected BuildingManager buildingManager
protected ResupplyManager resupplyManager
protected GoodsManager goodsManager
protected PowerGrid powerGrid
Constructor Detail |
---|
protected Settlement(java.lang.String name, Coordinates location)
name
- the settlement's namelocation
- the settlement's locationpublic Settlement(java.lang.String name, java.lang.String template, Coordinates location) throws java.lang.Exception
name
- the settlement's nametemplate
- for the settlementlocation
- the settlement's location
java.lang.Exception
- if settlement cannot be constructed.Method Detail |
---|
public int getPopulationCapacity()
public int getCurrentPopulationNum()
public java.util.Collection<Person> getInhabitants()
public int getAvailablePopulationCapacity()
public Person[] getInhabitantArray()
public java.util.Collection<Vehicle> getParkedVehicles()
public int getParkedVehicleNum()
public boolean lifeSupportCheck() throws java.lang.Exception
lifeSupportCheck
in interface LifeSupport
java.lang.Exception
- if error checking life support.public int getLifeSupportCapacity()
getLifeSupportCapacity
in interface LifeSupport
public double provideOxygen(double amountRequested) throws java.lang.Exception
provideOxygen
in interface LifeSupport
amountRequested
- the amount of oxygen requested from system (kg)
java.lang.Exception
- if error providing oxygen.public double getOxygenFlowModifier()
public double provideWater(double amountRequested) throws java.lang.Exception
provideWater
in interface LifeSupport
amountRequested
- the amount of water requested from system (kg)
java.lang.Exception
- if error providing water.public double getWaterFlowModifier()
public double getAirPressure()
getAirPressure
in interface LifeSupport
public double getAirPressureModifier()
public double getTemperature()
getTemperature
in interface LifeSupport
public double getTemperatureModifier()
public void timePassing(double time) throws java.lang.Exception
timePassing
in class Unit
time
- the amount of time passing (in millisols)
java.lang.Exception
- if error during time passing.public java.util.Collection<Person> getAffectedPeople()
getAffectedPeople
in interface Malfunctionable
public BuildingManager getBuildingManager()
public ResupplyManager getResupplyManager()
public GoodsManager getGoodsManager()
public Airlock getAvailableAirlock()
public PowerGrid getPowerGrid()
public java.lang.String getTemplate()
public java.util.Collection<Person> getAllAssociatedPeople()
public java.util.Collection<Vehicle> getAllAssociatedVehicles()
public void setMissionCreationOverride(boolean missionCreationOverride)
missionCreationOverride
- override for settlement mission creation.public boolean getMissionCreationOverride()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |