Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
18e69bcf
Commit
18e69bcf
authored
Aug 10, 2020
by
Christian Cabrera
Browse files
routing and trips
parent
777c3f90
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/local/RealWorldStreetsMovement.java
View file @
18e69bcf
...
...
@@ -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)
*/
p
rivate
double
[]
transformOwnWorldWindowToGPS
(
double
x
,
double
y
)
{
p
ublic
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
;
}
}
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/ModularMovementModel.java
View file @
18e69bcf
...
...
@@ -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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment