Merge remote-tracking branch 'origin/master' into design2015

This commit is contained in:
Steffen Schaefer committed 2015-06-11 11:31:32 +02:00
commit 073736efeb
2 files changed
+6 -6

No files matched your search

@@ -635,7 +635,7 @@ public class CandidateFinderImpl implements CandidateFinder {
} else {
Mark m = null;
if (instruction == PassingInstruction.Port || instruction == PassingInstruction.Starboard
|| instruction == PassingInstruction.FixedBearing) {
|| instruction == PassingInstruction.FixedBearing || instruction == PassingInstruction.Offset) {
m = w.getMarks().iterator().next();
} else if (instruction == PassingInstruction.Gate) {
Util.Pair<Mark, Mark> pair = getPortAndStarboardMarks(t, w);
@@ -701,8 +701,7 @@ public class CandidateFinderImpl implements CandidateFinder {
}
/**
* If <code>m</code> is contained in <code>lineMarks</code>, the distance to that line is calculated, else simply
* the distance to the m.
* Calculates the distance from p to each mark of w at the timepoint t.
*/
private List<Distance> calculateDistance(Position p, Waypoint w, TimePoint t) {
List<Distance> distances = new ArrayList<>();
@@ -741,7 +740,9 @@ public class CandidateFinderImpl implements CandidateFinder {
}
break;
case Offset:
// TODO
singleMark = true;
// TODO Actually an Offset mark has two marks, only the first of which actually counts as being rounded. The
// passing of the second mark is also of interest though.
break;
case None:
break;
@@ -812,7 +813,7 @@ public class CandidateFinderImpl implements CandidateFinder {
if (instruction == PassingInstruction.FixedBearing) {
b = w.getFixedBearing();
} else {
// TODO Mark at start or end of race
// TODO If the first of last waypoint is not a gate or line, this will lead to issues
Bearing before = race.getTrackedLegFinishingAt(w).getLegBearing(t);
Bearing after = race.getTrackedLegStartingAt(w).getLegBearing(t);
if (before != null && after != null) {
@@ -60,7 +60,6 @@ public class Edge implements Comparable<Edge> {
return "Edge from Waypoint " + start.getOneBasedIndexOfWaypoint() + " to " + end.getOneBasedIndexOfWaypoint() + ": " + getCost();
}
// TODO Only for Debugging!
@Override
public int compareTo(Edge o) {
return start != o.getStart() ? start.compareTo(o.getStart()) : end != o.getEnd() ? end.compareTo(o.getEnd()) : getCost().compareTo(o.getCost());