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
c72090d9
Commit
c72090d9
authored
Apr 28, 2020
by
Julian Zobel
Browse files
WiP: Adaptions to maximal path calculation for OSM Movement
parent
b8398839
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/local/RealWorldStreetsMovement.java
View file @
c72090d9
...
...
@@ -219,7 +219,8 @@ public class RealWorldStreetsMovement extends AbstractLocalMovementStrategy {
req
.
getHints
().
put
(
Routing
.
BLOCK_AREA
,
blockedAreas
);
}
if
(
allowAlternativeRoutes
)
{
req
.
setAlgorithm
(
Parameters
.
Algorithms
.
ALT_ROUTE
);
req
.
setAlgorithm
(
Parameters
.
Algorithms
.
ALT_ROUTE
);
req
.
getHints
().
put
(
Parameters
.
Algorithms
.
AltRoute
.
MAX_PATHS
,
"5"
);
}
...
...
@@ -244,6 +245,10 @@ public class RealWorldStreetsMovement extends AbstractLocalMovementStrategy {
if
(
allowAlternativeRoutes
&&
rsp
.
hasAlternatives
()
&&
rsp
.
getBest
().
getDistance
()
>
50
)
{
// alternative route is taken with a certain chance
if
(
random
.
nextDouble
()
<=
probabilityForAlternativeRoute
)
{
List
<
PathWrapper
>
paths
=
rsp
.
getAll
();
System
.
out
.
println
(
paths
.
size
());
pointList
=
rsp
.
getAll
().
get
(
1
).
getPoints
();
}
}
...
...
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