|
|
|
|
@ -261,7 +261,6 @@ public class MockRace extends Race {
|
|
|
|
|
|
|
|
|
|
//For each boat, we update its position, and generate a BoatLocationMessage.
|
|
|
|
|
for (MockBoat boat : boats) {
|
|
|
|
|
|
|
|
|
|
//If it is still racing, update its position.
|
|
|
|
|
if (boat.getStatus() == BoatStatusEnum.RACING) {
|
|
|
|
|
|
|
|
|
|
@ -417,6 +416,7 @@ public class MockRace extends Race {
|
|
|
|
|
*/
|
|
|
|
|
public boolean improvesVelocity(VMG currentVMG, VMG potentialVMG, Bearing bearingToDestination) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Calculates the angle between the boat and its destination.
|
|
|
|
|
Angle angleBetweenDestAndHeading = Angle.fromDegrees(currentVMG.getBearing().degrees() - bearingToDestination.degrees());
|
|
|
|
|
|
|
|
|
|
@ -478,7 +478,7 @@ public class MockRace extends Race {
|
|
|
|
|
boat.moveForwards(distanceTravelledMeters);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long tackPeriod = 15000;
|
|
|
|
|
long tackPeriod = 1000;
|
|
|
|
|
|
|
|
|
|
if (boat.getTimeSinceTackChange() > tackPeriod) {
|
|
|
|
|
//Calculate the new VMG.
|
|
|
|
|
|