org.mars_sim.msp.simulation.vehicle
Class Rover

java.lang.Object
  extended by org.mars_sim.msp.simulation.Unit
      extended by org.mars_sim.msp.simulation.vehicle.Vehicle
          extended by org.mars_sim.msp.simulation.vehicle.GroundVehicle
              extended by org.mars_sim.msp.simulation.vehicle.Rover
All Implemented Interfaces:
java.io.Serializable, LifeSupport, Malfunctionable, Airlockable, Crewable, Medical, Towing

public class Rover
extends GroundVehicle
implements Crewable, LifeSupport, Airlockable, Medical, Towing

The Rover class represents the rover type of ground vehicle. It contains information about the rover.

See Also:
Serialized Form

Field Summary
static double LIFE_SUPPORT_RANGE_ERROR_MARGIN
           
 
Fields inherited from class org.mars_sim.msp.simulation.vehicle.GroundVehicle
STUCK
 
Fields inherited from class org.mars_sim.msp.simulation.vehicle.Vehicle
EMERGENCY_BEACON_EVENT, MAINTENANCE, MALFUNCTION, malfunctionManager, MOVING, OPERATOR_EVENT, PARKED, RANGE_ERROR_MARGIN, RESERVED_EVENT, SPEED_EVENT, STATUS_EVENT, TOWED
 
Fields inherited from class org.mars_sim.msp.simulation.Unit
CONTAINER_UNIT_EVENT, DESCRIPTION_EVENT, LOCATION_EVENT, MASS_EVENT, NAME_EVENT
 
Fields inherited from interface org.mars_sim.msp.simulation.vehicle.Crewable
CREW_CAPACITY_EVENT
 
Constructor Summary
Rover(java.lang.String name, java.lang.String description, Settlement settlement)
          Constructs a Rover object at a given settlement
 
Method Summary
 java.util.Collection<Person> getAffectedPeople()
          Gets a collection of people affected by this entity.
 Airlock getAirlock()
          Gets the rover's airlock.
 double getAirPressure()
          Gets the air pressure of the life support system.
 java.util.Collection<Person> getCrew()
          Gets a collection of the crewmembers.
 int getCrewCapacity()
          Gets the number of crewmembers the vehicle can carry.
 int getCrewNum()
          Gets the current number of crewmembers.
 AmountResource getFuelType()
          Gets the resource type that this vehicle uses for fuel.
 Lab getLab()
          Gets the rover's laboratory
 int getLifeSupportCapacity()
          Gets the number of people the life support can provide for.
 double getRange()
          Gets the range of the vehicle
 SickBay getSickBay()
          Gets the rover's sickbay.
 double getTemperature()
          Gets the temperature of the life support system.
 Vehicle getTowedVehicle()
          Gets the vehicle this rover is currently towing.
 boolean hasLab()
          Checks if the rover has a laboratory.
 boolean hasSickBay()
          Checks if the rover has a sickbay.
 boolean isAppropriateOperator(VehicleOperator operator)
          Checks if a particular operator is appropriate for a vehicle.
 boolean isCrewmember(Person person)
          Checks if person is a crewmember.
 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 setCoordinates(Coordinates newLocation)
          Sets unit's location coordinates
 void setTowedVehicle(Vehicle towedVehicle)
          Sets the vehicle this rover is currently towing.
 void timePassing(double time)
          Perform time-related processes
 
Methods inherited from class org.mars_sim.msp.simulation.vehicle.GroundVehicle
getDriver, getElevation, getStatus, getTerrainGrade, getTerrainHandlingCapability, isStuck, setDriver, setElevation, setStuck, setTerrainHandlingCapability
 
Methods inherited from class org.mars_sim.msp.simulation.vehicle.Vehicle
addDistanceLastMaintenance, addTotalDistanceTraveled, addToTrail, clearDistanceLastMaintenance, getBaseSpeed, getDirection, getDistanceLastMaintenance, getEstimatedTravelDistancePerSol, getFuelEfficiency, getMalfunctionManager, getOperator, getSettlement, getSpeed, getTotalDistanceTraveled, getTowingVehicle, getTrail, isEmergencyBeacon, isReserved, isReservedForMaintenance, isReservedForMission, setBaseSpeed, setDirection, setEmergencyBeacon, setOperator, setReservedForMaintenance, setReservedForMission, setSpeed, setTowingVehicle
 
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, 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

LIFE_SUPPORT_RANGE_ERROR_MARGIN

public static final double LIFE_SUPPORT_RANGE_ERROR_MARGIN
See Also:
Constant Field Values
Constructor Detail

Rover

public Rover(java.lang.String name,
             java.lang.String description,
             Settlement settlement)
      throws java.lang.Exception
Constructs a Rover object at a given settlement

Parameters:
name - the name of the rover
description - the configuration description of the vehicle.
settlement - the settlement the rover is parked at
Throws:
java.lang.Exception - if rover could not be constructed.
Method Detail

setTowedVehicle

public void setTowedVehicle(Vehicle towedVehicle)
Sets the vehicle this rover is currently towing.

Specified by:
setTowedVehicle in interface Towing
Parameters:
towedVehicle - the vehicle being towed.

getTowedVehicle

public Vehicle getTowedVehicle()
Gets the vehicle this rover is currently towing.

Specified by:
getTowedVehicle in interface Towing
Returns:
towed vehicle.

getCrewCapacity

public int getCrewCapacity()
Gets the number of crewmembers the vehicle can carry.

Specified by:
getCrewCapacity in interface Crewable
Returns:
capacity

getCrewNum

public int getCrewNum()
Gets the current number of crewmembers.

Specified by:
getCrewNum in interface Crewable
Returns:
number of crewmembers

getCrew

public java.util.Collection<Person> getCrew()
Gets a collection of the crewmembers.

Specified by:
getCrew in interface Crewable
Returns:
crewmembers as Collection

isCrewmember

public boolean isCrewmember(Person person)
Checks if person is a crewmember.

Specified by:
isCrewmember in interface Crewable
Parameters:
person - the person to check
Returns:
true if person is a crewmember

lifeSupportCheck

public boolean lifeSupportCheck()
                         throws java.lang.Exception
Returns true if life support is working properly and is not out of oxygen or water.

Specified by:
lifeSupportCheck in interface LifeSupport
Returns:
true if life support is OK
Throws:
java.lang.Exception - if error checking life support.

getLifeSupportCapacity

public int getLifeSupportCapacity()
Gets the number of people the life support can provide for.

Specified by:
getLifeSupportCapacity in interface LifeSupport
Returns:
the capacity of the life support system

provideOxygen

public double provideOxygen(double amountRequested)
                     throws java.lang.Exception
Gets oxygen from system.

Specified by:
provideOxygen in interface LifeSupport
Parameters:
amountRequested - the amount of oxygen requested from system (kg)
Returns:
the amount of oxgyen actually received from system (kg)
Throws:
java.lang.Exception - if error providing oxygen.

provideWater

public double provideWater(double amountRequested)
                    throws java.lang.Exception
Gets water from system.

Specified by:
provideWater in interface LifeSupport
Parameters:
amountRequested - the amount of water requested from system (kg)
Returns:
the amount of water actually received from system (kg)
Throws:
java.lang.Exception - if error providing water.

getAirPressure

public double getAirPressure()
Gets the air pressure of the life support system.

Specified by:
getAirPressure in interface LifeSupport
Returns:
air pressure (atm)

getTemperature

public double getTemperature()
Gets the temperature of the life support system.

Specified by:
getTemperature in interface LifeSupport
Returns:
temperature (degrees C)

getAirlock

public Airlock getAirlock()
Gets the rover's airlock.

Specified by:
getAirlock in interface Airlockable
Returns:
rover's airlock

timePassing

public void timePassing(double time)
                 throws java.lang.Exception
Perform time-related processes

Overrides:
timePassing in class Vehicle
Parameters:
time - the amount of time passing (in millisols)
Throws:
exception - if error during time.
java.lang.Exception - if error during time.

getAffectedPeople

public java.util.Collection<Person> getAffectedPeople()
Gets a collection of people affected by this entity.

Specified by:
getAffectedPeople in interface Malfunctionable
Overrides:
getAffectedPeople in class Vehicle
Returns:
person collection

hasLab

public boolean hasLab()
Checks if the rover has a laboratory.

Returns:
true if lab.

getLab

public Lab getLab()
Gets the rover's laboratory

Returns:
lab

hasSickBay

public boolean hasSickBay()
Checks if the rover has a sickbay.

Returns:
true if sickbay

getSickBay

public SickBay getSickBay()
Gets the rover's sickbay.

Specified by:
getSickBay in interface Medical
Returns:
sickbay

isAppropriateOperator

public boolean isAppropriateOperator(VehicleOperator operator)
Checks if a particular operator is appropriate for a vehicle.

Specified by:
isAppropriateOperator in class Vehicle
Parameters:
operator - the operator to check
Returns:
true if appropriate operator for this vehicle.

getFuelType

public AmountResource getFuelType()
Gets the resource type that this vehicle uses for fuel.

Specified by:
getFuelType in class Vehicle
Returns:
resource type as a string

setCoordinates

public void setCoordinates(Coordinates newLocation)
Sets unit's location coordinates

Overrides:
setCoordinates in class Unit
Parameters:
newLocation - the new location of the unit

getRange

public double getRange()
                throws java.lang.Exception
Gets the range of the vehicle

Overrides:
getRange in class Vehicle
Returns:
the range of the vehicle (in km)
Throws:
java.lang.Exception - if error getting range.