Tests for genreating new coordinate added
#test #story[9]
This commit is contained in:
@@ -25,12 +25,12 @@ public class Constants {
|
||||
public static final GPSCoordinate finishLineMarker2 = new GPSCoordinate(32.317257, -64.836260);
|
||||
|
||||
public static final BoatInRace[] OFFICIAL_AC35_COMPETITORS = new BoatInRace[]
|
||||
{new BoatInRace("Oracle Team USA", 200.0, Color.BLUEVIOLET),
|
||||
new BoatInRace("Land Rover BAR", 180.0, Color.BLACK),
|
||||
new BoatInRace("SoftBank Team Japan", 190.0, Color.RED),
|
||||
new BoatInRace("Groupama Team France", 210.0, Color.ORANGE),
|
||||
new BoatInRace("Artemis Racing", 220.0, Color.DARKOLIVEGREEN),
|
||||
new BoatInRace("Emirates Team New Zealand", 310, Color.LIMEGREEN)};
|
||||
{new BoatInRace("Oracle Team USA", 300.0, Color.BLUEVIOLET),
|
||||
new BoatInRace("Land Rover BAR", 500.0, Color.BLACK),
|
||||
new BoatInRace("SoftBank Team Japan", 400.0, Color.RED),
|
||||
new BoatInRace("Groupama Team France", 350.0, Color.ORANGE),
|
||||
new BoatInRace("Artemis Racing", 440.0, Color.DARKOLIVEGREEN),
|
||||
new BoatInRace("Emirates Team New Zealand", 620, Color.LIMEGREEN)};
|
||||
|
||||
//public static final Leg bermudaCourseStartToMark1 = new Leg(0, , new )
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ public class ConstantVelocityRace extends Race {
|
||||
double distanceTravelled = boat.getVelocity() * millisecondsElapsed/3600000;
|
||||
double totalDistanceTravelled = distanceTravelled + boat.getDistanceTravelledInLeg();
|
||||
|
||||
if (!boat.getCurrentLeg().getName().equals("Finish")) {
|
||||
boolean finish = boat.getCurrentLeg().getName().equals("Finish");
|
||||
if (!finish) {
|
||||
|
||||
boat.setDistanceTravelledInLeg(totalDistanceTravelled);
|
||||
boat.setCurrentPosition(calculatePosition(boat.getCurrentLeg().getStartGraphCoordinate(),
|
||||
totalDistanceTravelled, boat.calculateAzimuth()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,8 +24,8 @@ public abstract class Race implements Runnable {
|
||||
protected long totalTimeElapsed;
|
||||
|
||||
|
||||
private int SLEEP_TIME = 25; //time in milliseconds to pause in a paced loop
|
||||
private int PRERACE_TIME = Integer.MAX_VALUE; //time in milliseconds to pause during pre-race
|
||||
private int SLEEP_TIME = 100; //time in milliseconds to pause in a paced loop
|
||||
private int PRERACE_TIME = 1000; //time in milliseconds to pause during pre-race
|
||||
|
||||
/**
|
||||
* Initailiser for Race
|
||||
|
||||
Reference in New Issue
Block a user