Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
JPScore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JuPedSim
JPScore
Commits
23d09e20
Commit
23d09e20
authored
Feb 3, 2019
by
Tobias Schrödter
Browse files
Options
Downloads
Patches
Plain Diff
FF now navigates from waiting area to final goal
parent
3d913f77
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
geometry/WaitingArea.cpp
+14
-1
14 additions, 1 deletion
geometry/WaitingArea.cpp
geometry/WaitingArea.h
+2
-0
2 additions, 0 deletions
geometry/WaitingArea.h
routing/ff_router_trips/ffRouterTrips.cpp
+6
-4
6 additions, 4 deletions
routing/ff_router_trips/ffRouterTrips.cpp
with
22 additions
and
5 deletions
geometry/WaitingArea.cpp
+
14
−
1
View file @
23d09e20
...
@@ -101,5 +101,18 @@ void WaitingArea::setWaitingTime(double waitingTime)
...
@@ -101,5 +101,18 @@ void WaitingArea::setWaitingTime(double waitingTime)
std
::
vector
<
Line
>
WaitingArea
::
getAllLines
()
std
::
vector
<
Line
>
WaitingArea
::
getAllLines
()
{
{
}
int
WaitingArea
::
GetNextGoal
()
{
double
random
=
std
::
rand
()
/
RAND_MAX
;
double
cumProb
=
0.
;
for
(
auto
&
nextGoal
:
nextGoals
){
cumProb
+=
nextGoal
.
second
;
if
(
random
<=
cumProb
){
return
nextGoal
.
first
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
geometry/WaitingArea.h
+
2
−
0
View file @
23d09e20
...
@@ -66,6 +66,8 @@ public:
...
@@ -66,6 +66,8 @@ public:
std
::
vector
<
Line
>
getAllLines
();
std
::
vector
<
Line
>
getAllLines
();
int
GetNextGoal
();
private:
private:
void
updateProbabilities
();
void
updateProbabilities
();
bool
checkProbabilities
();
bool
checkProbabilities
();
...
...
This diff is collapsed.
Click to expand it.
routing/ff_router_trips/ffRouterTrips.cpp
+
6
−
4
View file @
23d09e20
...
@@ -487,10 +487,12 @@ int FFRouterTrips::FindExit(Pedestrian* ped)
...
@@ -487,10 +487,12 @@ int FFRouterTrips::FindExit(Pedestrian* ped)
// yes: set next goal and return findExit(p)
// yes: set next goal and return findExit(p)
if
(
subroom
->
IsInSubRoom
(
goal
->
GetCentroid
())){
if
(
subroom
->
IsInSubRoom
(
goal
->
GetCentroid
())){
std
::
cout
<<
"Ped and Goal in same subroom: "
<<
subroom
->
IsInSubRoom
(
goal
->
GetCentroid
())
<<
std
::
endl
;
std
::
cout
<<
"Ped and Goal in same subroom: "
<<
subroom
->
IsInSubRoom
(
goal
->
GetCentroid
())
<<
std
::
endl
;
int
bestDoor
=
31
;
std
::
cout
<<
"Ped Final Destination before: "
<<
ped
->
GetFinalDestination
()
<<
std
::
endl
;
ped
->
SetExitIndex
(
bestDoor
);
if
(
WaitingArea
*
wa
=
dynamic_cast
<
WaitingArea
*>
(
goal
))
{
ped
->
SetExitLine
(
_CroTrByUID
.
at
(
bestDoor
));
ped
->
SetFinalDestination
(
wa
->
GetNextGoal
());
}
std
::
cout
<<
"Ped Final Destination after: "
<<
ped
->
GetFinalDestination
()
<<
std
::
endl
;
ret
=
FindExit1
(
ped
);
}
else
{
}
else
{
ret
=
FindExit1
(
ped
);
ret
=
FindExit1
(
ped
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment