Adding end coords to get test running gain

#story[20]
This commit is contained in:
Erika Savell
2017-03-28 14:38:08 +13:00
parent 176b644aaf
commit bb6b881392
4 changed files with 67 additions and 18 deletions
+10 -2
View File
@@ -30,6 +30,8 @@ public class Leg {
this.startGPSCoordinate = start;
this.endGPSCoordinate = end;
this.legNumber = number;
calculateStart();
calculateEnd();
this.distance = calculateDistance();
}
@@ -153,12 +155,18 @@ public class Leg {
private void calculateStart() {
//TO DO: Make this function set the start node as halfway between the two markers
this.startGPSCoordinate = startMarker1;
if (startMarker1 != null) {
this.startGPSCoordinate = startMarker1;
}
}
private void calculateEnd() {
//TO DO: Make this function set the end node as halfway between the two markers
this.endGPSCoordinate = endMarker1;
if (endMarker1 != null) {
this.endGPSCoordinate = endMarker1;
}
}
}
+2
View File
@@ -23,6 +23,7 @@ public abstract class Race implements Runnable {
protected int boatsFinished = 0;
protected long totalTimeElapsed;
protected int scaleFactor;
private int SLEEP_TIME = 100; //time in milliseconds to pause in a paced loop
@@ -70,6 +71,7 @@ public abstract class Race implements Runnable {
protected void initialiseBoats() {
System.out.println("boat initialisation");
Leg startLeg = legs.get(0);
Leg copyLeg = startLeg.createCopy();
ArrayList<GPSCoordinate> startPositions = getSpreadStartingPositions();