public class TriggerBoard extends Object implements Toggling
WeatherSensors.| Modifier and Type | Field and Description |
|---|---|
private double |
meanTrigger
The trigger mean value.
|
private double |
negativeTrigger
The trigger switch to turn this state to 'negative'.
|
private double |
positiveTrigger
The trigger switch to turn this state to 'positive'.
|
private boolean |
triggerState
The actual trigger state.
|
private double |
triggerValue
The actual trigger value.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TriggerBoard()
Empty constructor.
|
|
TriggerBoard(double mean,
double negative,
double positive)
Constructs a new trigger board with the given positive and negative
toggle switches.
|
|
TriggerBoard(String parameters)
Constructs a new trigger board with the three defining parameter
packed together in a string.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addHit(double value)
Adds a new value to this tirgger board.
|
boolean |
equalBoard(TriggerBoard that)
Two trigger boards are equal boards if they have the same trigger
switches.
|
boolean |
equals(Object that)
Two trigger boards are equal if they have the same trigger switches,
the same state and the same actual trigger value.
|
protected double |
getNegativeHit(double raw)
The impact of a negative value.
|
double |
getNegativeTrigger()
Returns the negative toggle value.
|
protected double |
getPositiveHit(double raw)
The impact of a positive value.
|
double |
getPositiveTrigger()
Returns the positive toggle value.
|
double |
getTriggerValue()
Returns the actual trigger value.
|
boolean |
isPositive()
Returns the state of the trigger board as a boolean.
|
protected void |
setTriggers(double negative,
double positive)
Sets the toggle values.
|
private double meanTrigger
private double positiveTrigger
private double negativeTrigger
private double triggerValue
private boolean triggerState
protected TriggerBoard()
public TriggerBoard(String parameters)
public TriggerBoard(double mean,
double negative,
double positive)
negative - The negative trigger value, ≤ 0positive - The positive trigger value, ≥ 0public boolean isPositive()
public boolean addHit(double value)
getPositiveHit(double) or getNegativeHit(double) to allow
subclasses to add, e.g. quadratic, impact.protected double getNegativeHit(double raw)
raw - An always-negative value.protected double getPositiveHit(double raw)
raw - An always-positive value.protected void setTriggers(double negative,
double positive)
negative - The negative trigger value, ≤ 0positive - The positive trigger value, ≥ 0IllegalArgumentException - if either of the trigger has a
forbidden value.public double getPositiveTrigger()
public double getNegativeTrigger()
public double getTriggerValue()
public boolean equalBoard(TriggerBoard that)
equals(java.lang.Object)public boolean equals(Object that)
equals in class ObjectequalBoard(stella.util.TriggerBoard)