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
21ee0785
Commit
21ee0785
authored
Feb 26, 2019
by
tobias schroedter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated FF Router to work with new door states
parent
32698668
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
17 deletions
+30
-17
routing/ff_router/FloorfieldViaFM.cpp
routing/ff_router/FloorfieldViaFM.cpp
+10
-7
routing/ff_router/UnivFFviaFM.cpp
routing/ff_router/UnivFFviaFM.cpp
+8
-4
routing/ff_router/ffRouter.cpp
routing/ff_router/ffRouter.cpp
+12
-6
No files found.
routing/ff_router/FloorfieldViaFM.cpp
View file @
21ee0785
...
...
@@ -369,7 +369,8 @@ void FloorfieldViaFM::createMapEntryInLineToGoalID(const int goalID)
double
cost_of_MIN3
=
DBL_MAX
;
long
int
dummykey
;
for
(
const
auto
&
loctrans
:
transitions
)
{
if
(
!
loctrans
.
second
->
IsExit
()
||
!
loctrans
.
second
->
IsOpen
())
{
//TODO if (!loctrans.second->IsExit() || !loctrans.second->IsOpen()) {
if
(
!
loctrans
.
second
->
IsExit
()
||
loctrans
.
second
->
IsClose
())
{
continue
;
}
dummykey
=
_grid
->
getKeyAtPoint
(
loctrans
.
second
->
GetCentre
());
...
...
@@ -488,9 +489,8 @@ void FloorfieldViaFM::parseBuilding(const Building* const buildingArg, const dou
//create a list of walls
const
std
::
map
<
int
,
Transition
*>&
allTransitions
=
buildingArg
->
GetAllTransitions
();
for
(
auto
&
trans
:
allTransitions
)
{
if
(
trans
.
second
->
IsExit
()
&&
trans
.
second
->
IsOpen
()
)
//TODO if (trans.second->IsExit() && trans.second->IsOpen())
if
(
trans
.
second
->
IsExit
()
&&
!
trans
.
second
->
IsClose
())
{
_exitsFromScope
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
...
...
@@ -500,6 +500,7 @@ void FloorfieldViaFM::parseBuilding(const Building* const buildingArg, const dou
}
_numOfExits
=
(
unsigned
int
)
_exitsFromScope
.
size
();
for
(
auto
&
trans
:
allTransitions
)
{
//TODO if (!trans.second->IsOpen()) {
if
(
!
trans
.
second
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
...
...
@@ -546,6 +547,7 @@ void FloorfieldViaFM::parseBuilding(const Building* const buildingArg, const dou
const
vector
<
Crossing
*>&
allCrossings
=
itSubroom
.
second
->
GetAllCrossings
();
for
(
Crossing
*
crossPtr
:
allCrossings
)
{
//TODO if (!crossPtr->IsOpen()) {
if
(
!
crossPtr
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
crossPtr
));
...
...
@@ -661,9 +663,8 @@ void FloorfieldViaFM::parseBuildingForExits(const Building* const buildingArg, c
//create a list of walls
const
std
::
map
<
int
,
Transition
*>&
allTransitions
=
buildingArg
->
GetAllTransitions
();
for
(
auto
&
trans
:
allTransitions
)
{
if
(
trans
.
second
->
IsExit
()
&&
trans
.
second
->
IsOpen
()
)
//TODO if (trans.second->IsExit() && trans.second->IsOpen())
if
(
trans
.
second
->
IsExit
()
&&
!
trans
.
second
->
IsClose
())
{
_exitsFromScope
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
int
roomID
=
-
1
;
...
...
@@ -683,6 +684,7 @@ void FloorfieldViaFM::parseBuildingForExits(const Building* const buildingArg, c
}
_numOfExits
=
(
unsigned
int
)
_exitsFromScope
.
size
();
for
(
auto
&
trans
:
allTransitions
)
{
//TODO if (!trans.second->IsOpen()) {
if
(
!
trans
.
second
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
...
...
@@ -731,6 +733,7 @@ void FloorfieldViaFM::parseBuildingForExits(const Building* const buildingArg, c
}
const
vector
<
Crossing
*>&
allCrossings
=
itSubroom
.
second
->
GetAllCrossings
();
for
(
Crossing
*
crossPtr
:
allCrossings
)
{
//TODO if (!crossPtr->IsOpen()) {
if
(
!
crossPtr
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
crossPtr
));
...
...
routing/ff_router/UnivFFviaFM.cpp
View file @
21ee0785
...
...
@@ -81,7 +81,8 @@ UnivFFviaFM::UnivFFviaFM(Room* roomArg, Configuration* const confArg, double hx,
bool
isOpen
=
false
;
for
(
auto
&
cross
:
tmpCross
)
{
uidNotConst
=
cross
->
GetUniqueID
();
isOpen
=
cross
->
IsOpen
();
//TODO isOpen = cross->IsOpen();
isOpen
=
!
cross
->
IsClose
();
if
(
!
isOpen
)
{
//will be added twice! is it a problem?
lines
.
emplace_back
((
Line
)
*
cross
);
...
...
@@ -94,7 +95,8 @@ UnivFFviaFM::UnivFFviaFM(Room* roomArg, Configuration* const confArg, double hx,
}
for
(
auto
&
trans
:
tmpTrans
)
{
uidNotConst
=
trans
->
GetUniqueID
();
isOpen
=
trans
->
IsOpen
();
//TODO isOpen = trans->IsOpen();
isOpen
=
!
trans
->
IsClose
();
if
(
!
isOpen
)
{
//will be added twice! is it a problem?
lines
.
emplace_back
((
Line
)
*
trans
);
...
...
@@ -167,7 +169,8 @@ UnivFFviaFM::UnivFFviaFM(SubRoom* subRoomArg, Configuration* const confArg, doub
bool
isOpen
=
false
;
for
(
auto
&
cross
:
tmpCross
)
{
uidNotConst
=
cross
->
GetUniqueID
();
isOpen
=
cross
->
IsOpen
();
//TODO isOpen = cross->IsOpen();
isOpen
=
!
cross
->
IsClose
();
if
(
!
isOpen
)
{
lines
.
emplace_back
((
Line
)
*
cross
);
}
else
{
...
...
@@ -176,7 +179,8 @@ UnivFFviaFM::UnivFFviaFM(SubRoom* subRoomArg, Configuration* const confArg, doub
}
for
(
auto
&
trans
:
tmpTrans
)
{
uidNotConst
=
trans
->
GetUniqueID
();
isOpen
=
trans
->
IsOpen
();
//TODO isOpen = trans->IsOpen();
isOpen
=
!
trans
->
IsClose
();
if
(
!
isOpen
)
{
lines
.
emplace_back
((
Line
)
*
trans
);
}
else
{
...
...
routing/ff_router/ffRouter.cpp
View file @
21ee0785
...
...
@@ -120,7 +120,8 @@ bool FFRouter::Init(Building* building)
std
::
vector
<
std
::
pair
<
int
,
int
>>
roomAndCroTrVector
;
roomAndCroTrVector
.
clear
();
for
(
auto
&
pair
:
allTrans
)
{
if
(
pair
.
second
->
IsOpen
())
{
//TODO if (pair.second->IsOpen()) {
if
(
!
pair
.
second
->
IsClose
())
{
_allDoorUIDs
.
emplace_back
(
pair
.
second
->
GetUniqueID
());
_CroTrByUID
.
insert
(
std
::
make_pair
(
pair
.
second
->
GetUniqueID
(),
pair
.
second
));
if
(
pair
.
second
->
IsExit
())
{
...
...
@@ -133,7 +134,8 @@ bool FFRouter::Init(Building* building)
}
}
for
(
auto
&
pair
:
allCross
)
{
if
(
pair
.
second
->
IsOpen
())
{
//TODO if (pair.second->IsOpen()) {
if
(
!
pair
.
second
->
IsClose
())
{
_allDoorUIDs
.
emplace_back
(
pair
.
second
->
GetUniqueID
());
_CroTrByUID
.
insert
(
std
::
make_pair
(
pair
.
second
->
GetUniqueID
(),
pair
.
second
));
Room
*
room1
=
pair
.
second
->
GetRoom1
();
...
...
@@ -494,13 +496,15 @@ int FFRouter::FindExit(Pedestrian* p)
if
(
!
_targetWithinSubroom
)
{
//candidates of current room (ID) (provided by Room)
for
(
auto
transUID
:
_building
->
GetRoom
(
p
->
GetRoomID
())
->
GetAllTransitionsIDs
())
{
if
((
_CroTrByUID
.
count
(
transUID
)
!=
0
)
&&
(
_CroTrByUID
[
transUID
]
->
IsOpen
()))
{
// TODO if ((_CroTrByUID.count(transUID) != 0) && (_CroTrByUID[transUID]->IsOpen())) {
if
((
_CroTrByUID
.
count
(
transUID
)
!=
0
)
&&
(
!
_CroTrByUID
[
transUID
]
->
IsClose
()))
{
DoorUIDsOfRoom
.
emplace_back
(
transUID
);
}
}
for
(
auto
&
subIPair
:
_building
->
GetRoom
(
p
->
GetRoomID
())
->
GetAllSubRooms
())
{
for
(
auto
&
crossI
:
subIPair
.
second
->
GetAllCrossings
())
{
if
(
crossI
->
IsOpen
())
{
// TODO if (crossI->IsOpen()) {
if
(
!
crossI
->
IsClose
())
{
DoorUIDsOfRoom
.
emplace_back
(
crossI
->
GetUniqueID
());
}
}
...
...
@@ -510,13 +514,15 @@ int FFRouter::FindExit(Pedestrian* p)
{
//candidates of current subroom only
for
(
auto
&
crossI
:
_building
->
GetRoom
(
p
->
GetRoomID
())
->
GetSubRoom
(
p
->
GetSubRoomID
())
->
GetAllCrossings
())
{
if
(
crossI
->
IsOpen
())
{
//TODO if (crossI->IsOpen()) {
if
(
!
crossI
->
IsClose
())
{
DoorUIDsOfRoom
.
emplace_back
(
crossI
->
GetUniqueID
());
}
}
for
(
auto
&
transI
:
_building
->
GetRoom
(
p
->
GetRoomID
())
->
GetSubRoom
(
p
->
GetSubRoomID
())
->
GetAllTransitions
())
{
if
(
transI
->
IsOpen
())
{
//TODO if (transI->IsClose()) {
if
(
!
transI
->
IsClose
())
{
DoorUIDsOfRoom
.
emplace_back
(
transI
->
GetUniqueID
());
}
}
...
...
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