cz.cuni.amis.pogamut.usar2004.agent.module.state
Class SuperState

Package class diagram package SuperState
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.agent.module.state.SuperState
Direct Known Subclasses:
StateAerial, StateGround, StateLegged, StateNautic

public class SuperState
extends Object

Parent class for all possible state subjects. It covers the basic and common properties for all the state subjects.

Author:
vejmanm

Field Summary
protected  StateMessage lastMessage
           
protected  VehicleType vehicleType
           
 
Constructor Summary
  SuperState()
          Ctor.
protected SuperState(VehicleType type)
          Ctor.
 
Method Summary
 int getBattery()
          Power state of the battery.
 int getFlashLightIntensity()
          Light intensity of the headlight.
 double getTime()
          Timestamp form the UT since server start in seconds.
 String getType()
          Type will be one of the following values: "GroundVehicle”, “LeggedRobot”, “NauticVehicle”, or “AerialVehicle”.
 VehicleType getVehicleType()
          VehicleType is a descriptor used for creating particular instance and for getting type information about particular state subject.
 boolean isFlashLightToogle()
          Indicate whether the headlight has been turned on.
 Boolean isReady()
          Used to make sure the object is filled.
 void updateMessage(StateMessage message)
          Method used for updating the message object that provides particular properties for given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastMessage

protected StateMessage lastMessage

vehicleType

protected VehicleType vehicleType
Constructor Detail

SuperState

public SuperState()
Ctor. State type describes particular subject about which we want to know about. It is used to distinguish incoming message from the server.


SuperState

protected SuperState(VehicleType type)
Ctor.

Parameters:
type - Configuration type describes particular subject about which we want to know about. It is used to distinguish incoming message from the server.
Method Detail

updateMessage

public void updateMessage(StateMessage message)
Method used for updating the message object that provides particular properties for given type. Note that this object is created by yylex parser and contains properties for all configuration subject types. But only relevat to individual Config Subject are filled.

Parameters:
message - State message from server.

getTime

public double getTime()
Timestamp form the UT since server start in seconds.

Returns:
Returns seconds elapsed from the start of the server.

isReady

public Boolean isReady()
Used to make sure the object is filled.

Returns:
Returns true if the object is filled with State message.

getType

public String getType()
Type will be one of the following values: "GroundVehicle”, “LeggedRobot”, “NauticVehicle”, or “AerialVehicle”.

Returns:
Returns Type of the vehicle.

getBattery

public int getBattery()
Power state of the battery. It is the battery lifetime in second. It’s the total time remaining for the robot to run.

Returns:
Returns remaining battery life.

getFlashLightIntensity

public int getFlashLightIntensity()
Light intensity of the headlight. Right now, it always is 100.

Returns:
Returns the intensity of the Headlight.

isFlashLightToogle

public boolean isFlashLightToogle()
Indicate whether the headlight has been turned on.

Returns:
Returns wether the Headlight is on or not.

getVehicleType

public VehicleType getVehicleType()
VehicleType is a descriptor used for creating particular instance and for getting type information about particular state subject.

Returns:
Returns VehicleType.


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.