Skip to content

Commit

Permalink
Merge pull request #122 from 12urenloop/external-lapper-lombok
Browse files Browse the repository at this point in the history
use lombok in external lapper
  • Loading branch information
FKD13 authored Mar 29, 2024
2 parents b65020a + 2938da5 commit 63dae07
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/main/java/telraam/logic/external/ExternalLapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void saveLaps(List<ExternalLapperTeamLaps> teamLaps) {

// Find which laps are no longer needed or have to be added
for (ExternalLapperTeamLaps teamLap : teamLaps) {
List<Lap> lapsForTeam = laps.stream().filter(l -> l.getTeamId() == teamLap.teamId).sorted(Comparator.comparing(Lap::getTimestamp)).toList();
List<Lap> newLapsForTeam = teamLap.laps.stream().map(nl -> new Lap(teamLap.teamId, lapSourceId, new Timestamp((long) (nl.timestamp)))).sorted(Comparator.comparing(Lap::getTimestamp)).toList();
List<Lap> lapsForTeam = laps.stream().filter(l -> l.getTeamId() == teamLap.getTeamId()).sorted(Comparator.comparing(Lap::getTimestamp)).toList();
List<Lap> newLapsForTeam = teamLap.getLaps().stream().map(nl -> new Lap(teamLap.getTeamId(), lapSourceId, new Timestamp((long) (nl.getTimestamp())))).sorted(Comparator.comparing(Lap::getTimestamp)).toList();

int lapsIndex = 0;
int newLapsIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package telraam.logic.external.models;

import lombok.Getter;
import lombok.Setter;

@Getter @Setter
public class ExternalLapperLap {
public double timestamp;
private double timestamp;
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
package telraam.logic.external.models;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter @Getter
public class ExternalLapperStats {
private List<Double> errorHistory;
private List<List<Double>> transitionMatrix;
private List<List<Double>> emissionMatrix;

public List<Double> getErrorHistory() {
return errorHistory;
}

public void setErrorHistory(List<Double> errorHistory) {
this.errorHistory = errorHistory;
}

public List<List<Double>> getTransitionMatrix() {
return transitionMatrix;
}

public void setTransitionMatrix(List<List<Double>> transitionMatrix) {
this.transitionMatrix = transitionMatrix;
}

public List<List<Double>> getEmissionMatrix() {
return emissionMatrix;
}

public void setEmissionMatrix(List<List<Double>> emissionMatrix) {
this.emissionMatrix = emissionMatrix;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package telraam.logic.external.models;

import lombok.Getter;
import lombok.Setter;

import java.util.List;


@Getter @Setter
public class ExternalLapperTeamLaps {
public int teamId;
public List<ExternalLapperLap> laps;
private int teamId;
private List<ExternalLapperLap> laps;
}

0 comments on commit 63dae07

Please sign in to comment.