-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/telraam/logic/positioner/nostradamus/StationData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package telraam.logic.positioner.nostradamus; | ||
|
||
import telraam.database.models.Station; | ||
|
||
import java.util.List; | ||
|
||
public record StationData( | ||
Station station, // The station | ||
Station nextStation, // The next station | ||
List<Long> averageTimes, // List containing the times (in ms) that was needed to run from this station to the next one. | ||
int index, // Index of this station when sorting a station list by distanceFromStart | ||
double currentProgress, // The progress value of this station | ||
double nextProgress // The progress value of the next station | ||
) { | ||
public StationData(List<Station> stations, int index, int averageAmount, int totalDistance) { | ||
this( | ||
stations.get(index), | ||
stations.get((index + 1) % stations.size()), | ||
new CircularQueue<>(averageAmount), | ||
index, | ||
stations.get(index).getDistanceFromStart() / totalDistance, | ||
stations.get((index + 1) % stations.size()).getDistanceFromStart() / totalDistance | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters