-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Multiplicative stairs and turn reluctance #6783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-2.x
Are you sure you want to change the base?
Changes from all commits
bd7e150
4c16517
42b9a3b
f512eac
d41495e
8cfebd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1021,14 +1021,16 @@ private StateEditor doTraverse(State s0, TraverseMode traverseMode, boolean walk | |
* that during reverse traversal, we must also use the speed for the mode of | ||
* the backEdge, rather than of the current edge. | ||
*/ | ||
var intersectionMode = arriveBy ? backMode : traverseMode; | ||
miklcct marked this conversation as resolved.
Show resolved
Hide resolved
|
||
boolean walkingBikeThroughIntersection = arriveBy ? s0.isBackWalkingBike() : walkingBike; | ||
if (arriveBy && tov instanceof IntersectionVertex traversedVertex) { // arrive-by search | ||
turnDuration = s0 | ||
.intersectionTraversalCalculator() | ||
.computeTraversalDuration( | ||
traversedVertex, | ||
this, | ||
backPSE, | ||
backMode, | ||
intersectionMode, | ||
(float) speed, | ||
(float) backSpeed | ||
); | ||
|
@@ -1039,7 +1041,7 @@ private StateEditor doTraverse(State s0, TraverseMode traverseMode, boolean walk | |
traversedVertex, | ||
backPSE, | ||
this, | ||
traverseMode, | ||
intersectionMode, | ||
(float) backSpeed, | ||
(float) speed | ||
); | ||
|
@@ -1049,8 +1051,18 @@ private StateEditor doTraverse(State s0, TraverseMode traverseMode, boolean walk | |
turnDuration = 0; | ||
} | ||
|
||
var modeReluctance = | ||
switch (intersectionMode) { | ||
case WALK -> walkingBikeThroughIntersection | ||
? preferences.bike().walking().reluctance() | ||
: preferences.walk().reluctance(); | ||
case BICYCLE -> preferences.bike().reluctance(); | ||
case SCOOTER -> preferences.scooter().reluctance(); | ||
case CAR -> preferences.car().reluctance(); | ||
case FLEX -> 1; | ||
}; | ||
time_ms += (long) Math.ceil(1000.0 * turnDuration); | ||
weight += preferences.street().turnReluctance() * turnDuration; | ||
weight += preferences.street().turnReluctance() * modeReluctance * turnDuration; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, reluctance is a factor. They can't be added together. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I made a mistake so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't work mathematically as well. For example, put turn reluctance as 0.5 and mode reluctance as 0.2, it will result in a negative number. |
||
} | ||
|
||
if (!traverseMode.isInCar()) { | ||
|
@@ -1152,10 +1164,6 @@ private TraversalCosts walkingTraversalCosts( | |
if (walkingBike) { | ||
// take slopes into account when walking bikes | ||
time = weight = (getEffectiveBikeDistance() / speed); | ||
if (isStairs()) { | ||
// we do allow walking the bike across a stairs but there is a very high default penalty | ||
weight *= preferences.bike().walking().stairsReluctance(); | ||
} | ||
} else { | ||
// take slopes into account when walking | ||
time = getEffectiveWalkDistance() / speed; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should clarify that this is used in addition to the walk reluctance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still unchanged.