Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JPScore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JuPedSim
JPScore
Commits
fd7c8519
Commit
fd7c8519
authored
May 12, 2015
by
Ulrich Kemloh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save commputation when there is only one alternative
parent
3cd4941f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
routing/GlobalRouter.cpp
routing/GlobalRouter.cpp
+15
-8
No files found.
routing/GlobalRouter.cpp
View file @
fd7c8519
...
...
@@ -828,25 +828,33 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
//double normFactor=0.0;
//map <int, double> doorProb;
// get the opened exits
SubRoom
*
sub
=
_building
->
GetRoom
(
ped
->
GetRoomID
())
->
GetSubRoom
(
ped
->
GetSubRoomID
());
// get the relevant opened exits
vector
<
AccessPoint
*>
relevantAPs
;
GetRelevantRoutesTofinalDestination
(
ped
,
relevantAPs
);
//cout<<"relevant APs size:" <<relevantAPs.size()<<endl;
//in the case there is only one alternative
//save some computation
if
(
relevantAPs
.
size
()
==
1
)
{
auto
&&
ap
=
relevantAPs
[
0
];
ped
->
SetExitIndex
(
ap
->
GetID
());
ped
->
SetExitLine
(
ap
->
GetNavLine
());
return
ap
->
GetID
();
}
int
bestAPsID
=
-
1
;
double
minDistGlobal
=
FLT_MAX
;
double
minDistLocal
=
FLT_MAX
;
// get the opened exits
SubRoom
*
sub
=
_building
->
GetRoom
(
ped
->
GetRoomID
())
->
GetSubRoom
(
ped
->
GetSubRoomID
());
//for (unsigned int i = 0; i < accessPointsInSubRoom.size(); i++) {
// int apID = accessPointsInSubRoom[i];
for
(
unsigned
int
g
=
0
;
g
<
relevantAPs
.
size
();
g
++
)
{
for
(
unsigned
int
g
=
0
;
g
<
relevantAPs
.
size
();
g
++
)
{
AccessPoint
*
ap
=
relevantAPs
[
g
];
//int exitid=ap->GetID();
//AccessPoint* ap = _accessPoints[apID];
if
(
ap
->
isInRange
(
sub
->
GetUID
())
==
false
)
continue
;
...
...
@@ -863,7 +871,6 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
//check if visible
if
(
sub
->
IsVisible
(
posA
,
posC
,
true
)
==
false
)
{
ped
->
RerouteIn
(
10
);
//ped->Dump(ped->GetID());
continue
;
}
...
...
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