uavsim.datatypes
Class Deviation

java.lang.Object
  extended by uavsim.datatypes.A_Deviation<Deviation>
      extended by uavsim.datatypes.Deviation
All Implemented Interfaces:
java.lang.Comparable<Deviation>, I_Unitable<Deviation>

public class Deviation
extends A_Deviation<Deviation>

Defines a percent deviation from zero on the interval [-1,+1].

Author:
Dan Tappan [06.07.11]

Field Summary
 
Fields inherited from class uavsim.datatypes.A_Deviation
_deviation, DEVIATION_MAX, DEVIATION_MIN
 
Constructor Summary
Deviation(double deviation)
          Creates a deviation object.
Deviation(double deviation, boolean isClamped)
          Creates a deviation object.
 
Method Summary
 Deviation add_(Deviation deviation)
          Adds another unit to this one.
 DeviationFree convertToDeviationFree()
          Converts this deviation to a DeviationFree.
protected  void setValue(double deviation)
          Sets the deviation.
 Deviation subtract_(Deviation deviation)
          Subtract another unit from this one.
 
Methods inherited from class uavsim.datatypes.A_Deviation
compareTo, getValue_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Deviation

public Deviation(double deviation)
Creates a deviation object.

Parameters:
deviation - - the deviation on the interval [-1,+1].

Deviation

public Deviation(double deviation,
                 boolean isClamped)
Creates a deviation object.

Parameters:
deviation - - the deviation on the interval [-1,+1].
isClamped - - zzz
Method Detail

add_

public Deviation add_(Deviation deviation)
Adds another unit to this one. The result cannot exceed the limits [-1,+1].

Parameters:
deviation - - the unit
Returns:
the result as a new unit

convertToDeviationFree

public DeviationFree convertToDeviationFree()
Converts this deviation to a DeviationFree.

Returns:
the deviation

setValue

protected void setValue(double deviation)
Sets the deviation.

Specified by:
setValue in class A_Deviation<Deviation>
Parameters:
deviation - - the deviation

subtract_

public Deviation subtract_(Deviation deviation)
Subtract another unit from this one. The result cannot exceed the limits [-1,+1].

Parameters:
deviation - - the unit
Returns:
the result as a new unit