Commit 18e69bcf authored by Christian Cabrera's avatar Christian Cabrera
Browse files

routing and trips

parent 777c3f90
......@@ -55,6 +55,7 @@ import de.tudarmstadt.maki.simonstrator.api.Binder;
import de.tudarmstadt.maki.simonstrator.api.Monitor;
import de.tudarmstadt.maki.simonstrator.api.Monitor.Level;
import de.tudarmstadt.maki.simonstrator.api.component.ComponentNotAvailableException;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.route.Route;
/**
* This movement strategy uses the data from osm and navigates the nodes throught streets to the destination
......@@ -291,7 +292,7 @@ public class RealWorldStreetsMovement extends AbstractLocalMovementStrategy {
* @param y
* @return The projected position in gps-coordinates (lat, long)
*/
private double[] transformOwnWorldWindowToGPS(double x, double y) {
public double[] transformOwnWorldWindowToGPS(double x, double y) {
double[] gps_coordinates = new double[2];
gps_coordinates[0] = latLower + (latUpper - latLower) * (worldDimensions.getY() - y)/worldDimensions.getY();
gps_coordinates[1] = lonLeft + (lonRight - lonLeft) * x/worldDimensions.getX();
......@@ -329,6 +330,16 @@ public class RealWorldStreetsMovement extends AbstractLocalMovementStrategy {
return positions;
}
/**
* Returns the current route of the component.
* @param ms
* @return
*/
public Route getCurrentRoute(SimLocationActuator ms) {
return this.currentRoutes.get(ms);
}
/**
* Calculates the length of a route in meters.
......@@ -399,4 +410,12 @@ public class RealWorldStreetsMovement extends AbstractLocalMovementStrategy {
public void setCreateUniqueFolders(boolean uniqueFolders) {
this.uniqueFolders = uniqueFolders;
}
public GraphHopper getHopper() {
return hopper;
}
public void setHopper(GraphHopper hopper) {
this.hopper = hopper;
}
}
......@@ -364,4 +364,8 @@ public class ModularMovementModel implements MovementModel, EventHandler, Attrac
public List<AttractionPoint> getAttractionPoints() {
return new Vector<AttractionPoint>(transition.getAllAttractionPoints());
}
public LocalMovementStrategy getLocalMovementStrategy() {
return this.localMovementStrategy;
}
}
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