Skip to content

Commit

Permalink
chore; remove prints statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Apr 20, 2024
1 parent 98d50ab commit a968e8b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/main/java/telraam/logic/positioner/Position.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ public void update(double progress, double speed) {
this.progress = progress;
this.speed = speed;
this.timestamp = System.currentTimeMillis();
System.out.println("Progress: " + progress + " | Speed: " + speed + " | Timestamp: " + timestamp);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public boolean addDetection(Detection e) {
// Is at a new station that is in front of the previous one.
previousStation = currentStation;
currentStation = stations.get(e.getStationId());
System.out.println("Station: " + currentStation.index());
long now = System.currentTimeMillis();
if (isNextStation()) {
// Only add the time if it goes forward by exactly one station
Expand Down Expand Up @@ -91,18 +90,11 @@ public void updatePosition() {
// Determine whether to speed up / slow down the animation or teleport it
double difference = (currentStation.currentProgress() - theoreticalProgress + 1) % 1;
if ((difference >= maxDeviance && difference <= 1 - maxDeviance) || currentStation.averageTimes().size() < 3) {
System.out.println("Too fast");
System.out.println("Size: " + currentStation.averageTimes().size());
System.out.print("Average times: ");
currentStation.averageTimes().forEach(time -> System.out.print(" | " + time));
System.out.println("");
System.out.println("Goal: " + currentStation.currentProgress() + " Theoretical: " + theoreticalProgress + " Difference: " + (currentStation.currentProgress() - theoreticalProgress + 1) % 1);
// Animation was too far behind or ahead so teleport
progress = currentStation.currentProgress();
speed = ((currentStation.nextProgress() - progress + 1) % 1) / getMedian();
} else {
// Animation is close enough, adjust so that we're synced at the next station
System.out.println("Good");
progress = theoreticalProgress;
speed = ((goalProgress - theoreticalProgress + 1) % 1) / (nextStationArrival - currentTime);
}
Expand Down

0 comments on commit a968e8b

Please sign in to comment.