|
|
|
@ -9,18 +9,18 @@ import java.util.Random;
|
|
|
|
* Created by jjg64 on 28/08/17.
|
|
|
|
* Created by jjg64 on 28/08/17.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class ShiftingWindGenerator implements WindGenerator {
|
|
|
|
public class ShiftingWindGenerator implements WindGenerator {
|
|
|
|
Bearing baselineBearing;
|
|
|
|
private Bearing baselineBearing;
|
|
|
|
double baseLineSpeed;
|
|
|
|
private double baseLineSpeed;
|
|
|
|
double windSpeedVariance = 5;
|
|
|
|
private double windSpeedVariance = 5;
|
|
|
|
double bearingVariance = 5; // In degrees
|
|
|
|
private double bearingVariance = 5; // In degrees
|
|
|
|
double oscillationVariance = 0.25;
|
|
|
|
private double oscillationVariance = 0.25;
|
|
|
|
double oscillationPeriod = 1e3 * 60 * 1; // In milliseconds
|
|
|
|
private double oscillationPeriod = 1e3 * 60 * 1; // In milliseconds
|
|
|
|
|
|
|
|
|
|
|
|
double timeOfLastOscillationReset = 0;
|
|
|
|
private double timeOfLastOscillationReset = 0;
|
|
|
|
double timeOfLastChange = 0;
|
|
|
|
private double timeOfLastChange = 0;
|
|
|
|
double timeSinceLastShift = 0; // Back / veer
|
|
|
|
private double timeSinceLastShift = 0; // Back / veer
|
|
|
|
|
|
|
|
|
|
|
|
boolean anticlockwise = false;
|
|
|
|
private boolean anticlockwise = false;
|
|
|
|
|
|
|
|
|
|
|
|
public ShiftingWindGenerator(Bearing baselineBearing, double baseLineSpeed) {
|
|
|
|
public ShiftingWindGenerator(Bearing baselineBearing, double baseLineSpeed) {
|
|
|
|
this.baselineBearing = baselineBearing;
|
|
|
|
this.baselineBearing = baselineBearing;
|
|
|
|
|