Constructor and Description |
---|
NiceBrakes() |
Modifier and Type | Method and Description |
---|---|
double |
getSpeedReduction(java.lang.Double excertedForce)
Reduces the speed by a factor based on the input
parameter.
|
boolean |
reportIfBroken(double threshold)
Picks a random number in range [0,1] and if this random
number is larger than the input threshold then returns false.
|
public double getSpeedReduction(java.lang.Double excertedForce)
getSpeedReduction
in interface IBrakes
excertedForce
- the value of the force which is applied
to the break.public boolean reportIfBroken(double threshold)
reportIfBroken
in interface IBrakes