changed target definition so that it uses external server URL to fetch target platform contents

This commit is contained in:
Axel Uhl committed 2011-12-30 14:04:12 +01:00
1 parent b88b15cd33
commit cd1425520b
6 files changed
+21 -8

No files matched your search

@@ -10,7 +10,9 @@ import com.sap.sailing.domain.common.Util.Pair;
/**
* Contains a number of {@link Bearing} objects and maintains the average bearing. For a given {@link Bearing} it
* can determine the difference to this cluster's average bearing. It can also split the cluster into two, based
* on the two bearings farthest apart.<p>
* on the two bearings farthest apart. The cluster can contain multiple occurrences of the same and also
* multiple occurrences of mutually equal {@link Bearing} objects which is one possible way of computing a
* weighted average.<p>
*
* It is assumed that bearings added to this cluster are no further than 180 degrees apart. Violating this
* rule will lead to unpredictable results.
@@ -15,7 +15,7 @@ import com.sap.sailing.util.impl.DescendingNavigableSet;
/**
* Emulates a collection of {@link Wind} fixes for a {@link TrackedRace}, computed using
* {@link TrackedRace#getEstimatedWindDirection(com.sap.sailing.domain.base.Position, TimePoint)}. If not contrained
* {@link TrackedRace#getEstimatedWindDirection(com.sap.sailing.domain.base.Position, TimePoint)}. If not constrained
* by a {@link #from} and/or a {@link #to} time point, an equidistant time field is assumed, starting at
* {@link TrackedRace#getStart()} and leading up to {@link TrackedRace#getTimePointOfNewestEvent()}. If
* {@link TrackedRace#getStart()} returns <code>null</code>, {@link Long#MAX_VALUE} is used as the {@link #from}
@@ -26,6 +26,12 @@ import com.sap.sailing.util.impl.ArrayListNavigableSet;
* computed from the tracked race's boat tracks.
* <p>
*
* The estimation is integrated into the {@link WindTrackImpl} concepts by redefining the {@link #getInternalRawFixes()}
* method such that it returns an {@link EstimatedWindFixesAsNavigableSet} object. It computes its values by asking back
* to {@link #getEstimatedWindDirection(Position, TimePoint)} which first performs a cache look-up. In case of a cache
* miss it determines the result based on {@link TrackedRace#getEstimatedWindDirection(Position, TimePoint)}.
* <p>
*
* Caching is done using the base class's {@link TrackImpl#fixes} field which is made accessible through
* {@link #getCachedFixes()}. This track observes the {@link TrackedRace} for which it provides wind estimations.
* Whenever a change occurs, all fixes whose derivation is potentially affected by the change are removed from the
@@ -555,7 +555,6 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
@Override
public Wind getEstimatedWindDirection(Position position, TimePoint timePoint) {
int count = 0; // counts how many boats' courses were used in computing the result
Map<LegType, BearingCluster> bearings = new HashMap<LegType, BearingCluster>();
for (LegType legType : LegType.values()) {
bearings.put(legType, new BearingCluster());
@@ -573,6 +572,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
}
if (legType != LegType.REACHING) {
GPSFixTrack<Competitor, GPSFixMoving> track = getTrack(competitor);
// TODO bug #167 could be fixed here by excluding competitors that are x seconds before/after a mark passing
if (!track.hasDirectionChange(timePoint, getManeuverDegreeAngleThreshold())) {
Bearing bearing = track.getEstimatedSpeed(timePoint).getBearing();
BearingCluster bearingClusters = bearings.get(legType);
@@ -582,17 +582,20 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
}
}
Bearing upwindAverage = null;
int upwindConfidence = 0;
BearingCluster[] bearingClustersUpwind = bearings.get(LegType.UPWIND).splitInTwo(getMinimumAngleBetweenDifferentTacksUpwind());
if (!bearingClustersUpwind[0].isEmpty() && !bearingClustersUpwind[1].isEmpty()) {
upwindAverage = bearingClustersUpwind[0].getAverage().middle(bearingClustersUpwind[1].getAverage());
count += bearingClustersUpwind[0].size() + bearingClustersUpwind[1].size();
upwindConfidence = Math.min(bearingClustersUpwind[0].size(), bearingClustersUpwind[1].size());
}
Bearing downwindAverage = null;
int downwindConfidence = 0;
BearingCluster[] bearingClustersDownwind = bearings.get(LegType.DOWNWIND).splitInTwo(getMinimumAngleBetweenDifferentTacksDownwind());
if (!bearingClustersDownwind[0].isEmpty() && !bearingClustersDownwind[1].isEmpty()) {
downwindAverage = bearingClustersDownwind[0].getAverage().middle(bearingClustersDownwind[1].getAverage());
count += bearingClustersDownwind[0].size() + bearingClustersDownwind[1].size();
downwindConfidence = Math.min(bearingClustersDownwind[0].size(), bearingClustersDownwind[1].size());
}
int confidence = upwindConfidence + downwindConfidence;
Bearing bearing;
if (upwindAverage == null) {
if (downwindAverage == null) {
@@ -608,7 +611,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
}
}
return new WindImpl(null, timePoint,
new KnotSpeedWithBearingImpl(/* speedInKnots */ count, bearing));
new KnotSpeedWithBearingImpl(/* speedInKnots */ confidence, bearing));
}
/**
@@ -16,7 +16,7 @@
<location includeAllPlatforms="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="com.sap.sailing.target.base.feature.group" version="1.0.0"/>
<unit id="com.sap.sailing.target.test.feature.group" version="1.0.0"/>
<repository location="file:/home/trac/p2-repositories/sailing"/>
<repository location="http://sapcoe-app01.pironet-ndh.com/p2/sailing/"/>
</location>
<location includeAllPlatforms="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.7.0.v20110506-0800-7uF9LFp7FWmE7gTBiKg15LDD"/>
@@ -10,7 +10,9 @@
<repository location="http://nexus.wdf.sap.corp:8081/nexus/content/repositories/build.snapshots.unzip/com/sap/ui5/com.sap.ui5.updatesite/1.1.0/com.sap.ui5.updatesite-1.1.0-assembly.zip-unzip/"/>
</location>
<location includeAllPlatforms="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<repository location="file:/C:/data/SAP/sailing/workspace/java/com.sap.sailing.targetplatform.base/gen/p2"/>
<unit id="com.sap.sailing.target.base.feature.group" version="1.0.0"/>
<unit id="com.sap.sailing.target.test.feature.group" version="1.0.0"/>
<repository location="http://sapcoe-app01.pironet-ndh.com/p2/sailing/"/>
</location>
<location includeAllPlatforms="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.bundles.f.feature.group" version="7.5.4"/>