-Not complete! Still need to create function to calculate new coordinates -Doesn't run because of problems with resource folder #refactormain
parent
b73fee2cb5
commit
6f509e25ea
@ -1,79 +0,0 @@
|
|||||||
//package seng302;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * Created by fwy13 on 3/03/17.
|
|
||||||
// */
|
|
||||||
//public class Event {
|
|
||||||
// private Leg leg;
|
|
||||||
// private Boat boat;
|
|
||||||
// private int time;
|
|
||||||
// private Leg goalMarker;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Initaliser for Racemaker without a goal node (such as the Finish line).
|
|
||||||
// * @param leg current Racemarker that has just been passed.
|
|
||||||
// * @param boat Boat that has been passed.
|
|
||||||
// * @param time time in seconds that the event occurred.
|
|
||||||
// * @see Leg
|
|
||||||
// * @see seng302.Boat
|
|
||||||
// */
|
|
||||||
// public Event(Leg leg, Boat boat, int time){
|
|
||||||
// this.leg = leg;
|
|
||||||
// this.boat = boat;
|
|
||||||
// this.time = time;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Initaliser for Racemaker with a goal node.
|
|
||||||
// * @param leg current Racemarker that has just been passed.
|
|
||||||
// * @param boat Boat that has been passed.
|
|
||||||
// * @param time time in seconds that the event occurred.
|
|
||||||
// * @param goalMarker the next marker that the boat is aiming for.
|
|
||||||
// * @see Leg
|
|
||||||
// * @see seng302.Boat
|
|
||||||
// */
|
|
||||||
// public Event(Leg leg, Boat boat, int time, Leg goalMarker){
|
|
||||||
// this.leg = leg;
|
|
||||||
// this.boat = boat;
|
|
||||||
// this.time = time;
|
|
||||||
// this.goalMarker = goalMarker;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @return the leg that the boat has just passed.
|
|
||||||
// */
|
|
||||||
// public Leg getLeg() {
|
|
||||||
// return leg;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @return the boat that this event occured for.
|
|
||||||
// */
|
|
||||||
// public Boat getBoat() {
|
|
||||||
// return boat;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @return the time the event occurred
|
|
||||||
// */
|
|
||||||
// public int getTime(){
|
|
||||||
// return this.time;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @return the event as a string in format {Boat Name} passed {Leg Name} at {Time Event Occurred} seconds at heading {Heading}.
|
|
||||||
// */
|
|
||||||
// public String toString() {
|
|
||||||
// String stringToReturn = boat.getName() + " passed " + leg.toString() + " at " + time + " seconds";
|
|
||||||
// if (goalMarker != null){
|
|
||||||
// stringToReturn += " at heading " + (int) calculateHeading();
|
|
||||||
// }
|
|
||||||
// stringToReturn += ".";
|
|
||||||
// return stringToReturn;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
package seng302;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by esa46 on 15/03/17.
|
||||||
|
*/
|
||||||
|
public class GPSCoordinate {
|
||||||
|
|
||||||
|
private double latitude;
|
||||||
|
private double longitude;
|
||||||
|
|
||||||
|
public GPSCoordinate(double latitude, double longitude) { this.latitude = latitude; this.longitude = longitude; }
|
||||||
|
|
||||||
|
public double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
//package seng302;
|
|
||||||
//
|
|
||||||
//import java.util.Collections;
|
|
||||||
//import java.util.Random;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * Created by cbt24 on 6/03/17.
|
|
||||||
// */
|
|
||||||
//public class RandomisedRace extends Race {
|
|
||||||
// /**
|
|
||||||
// * Randomise race, this is a race that the boats cross each mark randomly, and is a extension of Race.
|
|
||||||
// * @param boats
|
|
||||||
// * @param marks
|
|
||||||
// * @param timescale
|
|
||||||
// * @see seng302.Race
|
|
||||||
// */
|
|
||||||
// public RandomisedRace(Boat[] boats, Leg[] marks, int timescale) {
|
|
||||||
// super(boats, marks, timescale);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Generates the Race to be reported when Simulate Race in the Race class is called.
|
|
||||||
// * @see Race#simulateRace()
|
|
||||||
// */
|
|
||||||
// protected void generateRace() {
|
|
||||||
// Random rand = new Random();
|
|
||||||
// for (Boat boat: this.boats){
|
|
||||||
// events.add(new Event(new Leg("Start", 0, 0, 0), boat, 0));
|
|
||||||
// int prevTime = 0;
|
|
||||||
// for (Leg raceMarker: marks){
|
|
||||||
// int time = rand.nextInt(12) + 6;
|
|
||||||
// events.add(new Event(raceMarker, boat, prevTime + time));
|
|
||||||
// prevTime += time;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// Collections.sort(events, (o1, o2) -> o1.getTime() - o2.getTime());
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
Loading…
Reference in new issue