mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 12:23:55 +00:00
adapt streamlets in simulator to recent changes for spatial-wind; tune parameters; fix long-delay of streamlet-initialization; (reverted from commit d41fd00de4)
This commit is contained in:
1 parent
7142896e8c
commit
c30ace8bb9
4 files changed
+11
-19
No files matched your search
+2
-11
@@ -106,11 +106,6 @@ public class WindStreamletsRaceboardOverlay extends FullCanvasOverlay {
|
||||
}
|
||||
|
||||
private void scheduleWindDataRefresh() {
|
||||
// initial update
|
||||
updateWindSourcesToObserve();
|
||||
updateWindField();
|
||||
|
||||
// schedule delayed repeated updates
|
||||
scheduler.scheduleFixedPeriod(new RepeatingCommand() {
|
||||
@Override
|
||||
public boolean execute() {
|
||||
@@ -151,12 +146,8 @@ public class WindStreamletsRaceboardOverlay extends FullCanvasOverlay {
|
||||
windInfoForRace.raceIsKnownToStartUpwind = result.raceIsKnownToStartUpwind;
|
||||
windInfoForRace.windSourcesToExclude = result.windSourcesToExclude;
|
||||
for (Entry<WindSource, WindTrackInfoDTO> e : result.windTrackInfoByWindSource.entrySet()) {
|
||||
// generally exclude combined wind, course-based wind and racecommittee
|
||||
if (!windInfoForRace.windTrackInfoByWindSource.containsKey(e.getKey())
|
||||
&& !Util.contains(result.windSourcesToExclude, e.getKey())
|
||||
&& e.getKey().getType() != WindSourceType.COMBINED
|
||||
&& e.getKey().getType() != WindSourceType.COURSE_BASED
|
||||
&& e.getKey().getType() != WindSourceType.RACECOMMITTEE) {
|
||||
if (!windInfoForRace.windTrackInfoByWindSource.containsKey(e.getKey()) &&
|
||||
!Util.contains(result.windSourcesToExclude, e.getKey()) && e.getKey().getType() != WindSourceType.COMBINED) {
|
||||
windInfoForRace.windTrackInfoByWindSource.put(e.getKey(), e.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ public class StreamletParameters {
|
||||
public double motionScale = 1.0;
|
||||
public double swarmScale = 1.0;
|
||||
public int detailZoom = 15;
|
||||
public double lineScale = 1.0;
|
||||
public double lineBase = 1.5;
|
||||
public double lineScale = 0.1;
|
||||
public double lineBase = 1.2;
|
||||
|
||||
public StreamletParameters() {
|
||||
}
|
||||
|
||||
+2
-1
@@ -74,7 +74,8 @@ public class WindStreamletsCanvasOverlay extends FullCanvasOverlay implements Ti
|
||||
}
|
||||
|
||||
public void setWindField(final WindFieldDTO windFieldDTO) {
|
||||
this.windFieldDTO = windFieldDTO;
|
||||
this.windFieldDTO = windFieldDTO;
|
||||
this.swarm = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-5
@@ -31,9 +31,9 @@ public class SimulatorField implements VectorField {
|
||||
private final Position bdC;
|
||||
|
||||
private final double xScale;
|
||||
private double motionFactor;
|
||||
private double lineBase;
|
||||
private double lineScale;
|
||||
private double motionFactor;
|
||||
private double lineBase;
|
||||
private double lineScale;
|
||||
private final double maxLength;
|
||||
private final double particleFactor;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class SimulatorField implements VectorField {
|
||||
}
|
||||
}
|
||||
this.maxLength = maxWindSpeed;
|
||||
this.particleFactor = 2.0;
|
||||
this.particleFactor = 1.0;
|
||||
final double latAvg = (this.rcEnd.getLatDeg() + this.rcStart.getLatDeg()) / 2.;
|
||||
this.lngScale = Math.cos(latAvg * Math.PI / 180.0);
|
||||
final double difLat = this.rcEnd.getLatDeg() - this.rcStart.getLatDeg();
|
||||
@@ -151,7 +151,7 @@ public class SimulatorField implements VectorField {
|
||||
+ dataAtStep[idx.yTop][2 * idx.xBot + 1] * idx.yMod * (1 - idx.xMod)
|
||||
+ dataAtStep[idx.yBot][2 * idx.xTop + 1] * (1 - idx.yMod) * idx.xMod
|
||||
+ dataAtStep[idx.yTop][2 * idx.xTop + 1] * idx.yMod * idx.xMod;
|
||||
return new Vector(avgX / this.lngScale, avgY);
|
||||
return new Vector(avgX, avgY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user