Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: Container Registry, Job Artifacs,. Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit fa5f3eaf authored by Lukas Bram's avatar Lukas Bram
Browse files

fix upper speed limit service

parent 5212b671
Pipeline #397542 passed with stage
in 1 minute
......@@ -72,13 +72,13 @@ public class SpeedLimitService extends EEComponent {
//System.out.println("testest");
double[] maxSpeedArr = fetchUpperSpeedLimits();
//sendMessage(time, upperSpeedLimitMsg, new double[]{0,0,0,0,0,0,0,0,0,0}, 8*trajectoryLength);
sendMessage(time, upperSpeedLimitMsg, maxSpeedArr, 8*trajectoryLength);
sendMessage(time, upperSpeedLimitMsg, maxSpeedArr, 8*(trajectoryLength - 1));
}
private double[] fetchUpperSpeedLimits() {
Vector<Way> ways = world.ways;
double[] maxSpeedArr = new double[trajectoryLength];
for (int i=0; i < trajectoryLength; i++){
double[] maxSpeedArr = new double[trajectoryLength - 1];
for (int i=0; i < trajectoryLength - 1; i++){
maxSpeedArr[i] = -1;
}
if ( trajectoryX != null && trajectoryLength > 1){
......@@ -139,6 +139,7 @@ public class SpeedLimitService extends EEComponent {
pointInformation.ways.add(way);
if (way.nodeID.get(i) != -1) {
pointInformation.node = world.nodes.get(way.nodeID.get(i));
pointInformation.ways.addAll(pointInformation.node.ways);
}
}
}
......@@ -146,26 +147,6 @@ public class SpeedLimitService extends EEComponent {
return pointInformation;
}
// private Vector<Node> getWayNodes(World world, Way way) {
// Vector<Node> wayNodes = new Vector<Node>();
// for (int nodeId : way.nodeID){
// wayNodes.add(world.nodes.get(nodeId));
// }
// return wayNodes;
// }
// private Optional<Way> getNextWay(Node node, double x, double y){
// if (node.ways.size() != 0) {
// for (Way way : node.ways){
// if (getNodeIdOfPoint(getWayNodes(world, way),x,y).isPresent()) {
// return Optional.of(way);
// }
// }
// }
//
// return Optional.empty();
// }
/**
* @Class: PointInformation
* It provides information about a specific point from the world.*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment