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
ae146701
Commit
ae146701
authored
Feb 26, 2019
by
tobias schroedter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated FF Router Trips to work with new door states
parent
21ee0785
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
48 deletions
+52
-48
routing/ff_router_trips/FloorfieldViaFMTrips.cpp
routing/ff_router_trips/FloorfieldViaFMTrips.cpp
+22
-22
routing/ff_router_trips/FloorfieldViaFMTrips.h
routing/ff_router_trips/FloorfieldViaFMTrips.h
+0
-1
routing/ff_router_trips/UnivFFviaFMTrips.cpp
routing/ff_router_trips/UnivFFviaFMTrips.cpp
+17
-15
routing/ff_router_trips/ffRouterTrips.cpp
routing/ff_router_trips/ffRouterTrips.cpp
+13
-10
No files found.
routing/ff_router_trips/FloorfieldViaFMTrips.cpp
View file @
ae146701
...
...
@@ -371,8 +371,8 @@ void FloorfieldViaFMTrips::createMapEntryInLineToGoalID(const int goalID, bool i
UID_of_MIN
=
allgoals
.
at
(
goalID
)
->
GetCentreCrossing
()
->
GetUniqueID
();
}
else
{
for
(
const
auto
&
loctrans
:
transitions
)
{
//
if (!loctrans.second->IsExit() || !loctrans.second->IsOpen()) {
if
(
!
loctrans
.
second
->
IsExit
())
{
//TODO
if (!loctrans.second->IsExit() || !loctrans.second->IsOpen()) {
if
(
!
loctrans
.
second
->
IsExit
()
||
loctrans
.
second
->
IsClose
()
)
{
continue
;
}
...
...
@@ -494,9 +494,8 @@ void FloorfieldViaFMTrips::parseBuilding(const Building* const buildingArg, cons
//create a list of walls
const
std
::
map
<
int
,
Transition
*>&
allTransitions
=
buildingArg
->
GetAllTransitions
();
for
(
auto
&
trans
:
allTransitions
)
{
// TODO temp_close
// if (trans.second->IsExit() && trans.second->IsOpen())
if
(
trans
.
second
->
IsExit
()
)
{
//TODO if (trans.second->IsExit() && trans.second->IsOpen()){
if
(
trans
.
second
->
IsExit
()
&&
!
trans
.
second
->
IsClose
()){
_exitsFromScope
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
//populate both maps: costmap, neggradmap. These are the lookup maps for floorfields to specific transitions
...
...
@@ -505,13 +504,13 @@ void FloorfieldViaFMTrips::parseBuilding(const Building* const buildingArg, cons
}
_numOfExits
=
(
unsigned
int
)
_exitsFromScope
.
size
();
// TODO temp_close
// for (auto& trans : allTransitions
) {
//
if (!trans.second->IsOpen()) {
//
_wall.emplace_back(Line ( (Line) *(trans.second)));
//
}
//
//
}
for
(
auto
&
trans
:
allTransitions
)
{
//TODO if (!trans.second->IsOpen()
) {
if
(
!
trans
.
second
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
}
for
(
const
auto
&
itRoom
:
buildingArg
->
GetAllRooms
())
{
for
(
const
auto
&
itSubroom
:
itRoom
.
second
->
GetAllSubRooms
())
{
...
...
@@ -554,6 +553,7 @@ void FloorfieldViaFMTrips::parseBuilding(const Building* const buildingArg, cons
const
vector
<
Crossing
*>&
allCrossings
=
itSubroom
.
second
->
GetAllCrossings
();
for
(
Crossing
*
crossPtr
:
allCrossings
)
{
//TODO if (!crossPtr->IsOpen()) {
if
(
!
crossPtr
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
crossPtr
));
...
...
@@ -669,9 +669,8 @@ void FloorfieldViaFMTrips::parseBuildingForExits(const Building* const buildingA
//create a list of walls
const
std
::
map
<
int
,
Transition
*>&
allTransitions
=
buildingArg
->
GetAllTransitions
();
for
(
auto
&
trans
:
allTransitions
)
{
// TODO temp_close
// if ( trans.second->IsExit() && trans.second->IsOpen() ) {
if
(
trans
.
second
->
IsExit
()
)
{
//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
;
if
(
trans
.
second
->
GetRoom1
())
{
...
...
@@ -689,13 +688,13 @@ void FloorfieldViaFMTrips::parseBuildingForExits(const Building* const buildingA
_neggradmap
.
emplace
(
trans
.
second
->
GetUniqueID
(),
nullptr
);
}
_numOfExits
=
(
unsigned
int
)
_exitsFromScope
.
size
();
// TODO temp_close
// for (auto& trans : allTransitions
) {
//
if (!trans.second->IsOpen()) {
//
_wall.emplace_back(Line ( (Line) *(trans.second)));
//
}
//
//
}
for
(
auto
&
trans
:
allTransitions
)
{
//TODO if (!trans.second->IsOpen()
) {
if
(
!
trans
.
second
->
IsOpen
())
{
_wall
.
emplace_back
(
Line
(
(
Line
)
*
(
trans
.
second
)));
}
}
for
(
const
auto
&
itRoom
:
buildingArg
->
GetAllRooms
())
{
if
(
std
::
find
(
exitRoomIDs
.
begin
(),
exitRoomIDs
.
end
(),
itRoom
.
second
->
GetID
())
==
exitRoomIDs
.
end
())
{
//room with no exit
continue
;
...
...
@@ -739,6 +738,7 @@ void FloorfieldViaFMTrips::parseBuildingForExits(const Building* const buildingA
}
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_trips/FloorfieldViaFMTrips.h
View file @
ae146701
...
...
@@ -159,7 +159,6 @@ public:
{
return
_goalToLineUIDmap
;
}
std
::
map
<
int
,
int
>
getGoalToLineUIDmap2
()
const
{
return
_goalToLineUIDmap2
;
...
...
routing/ff_router_trips/UnivFFviaFMTrips.cpp
View file @
ae146701
...
...
@@ -87,7 +87,8 @@ UnivFFviaFMTrips::UnivFFviaFMTrips(Room* roomArg, Configuration* const confArg,
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
);
...
...
@@ -100,17 +101,17 @@ UnivFFviaFMTrips::UnivFFviaFMTrips(Room* roomArg, Configuration* const confArg,
}
for
(
auto
&
trans
:
tmpTrans
)
{
uidNotConst
=
trans
->
GetUniqueID
();
isOpen
=
trans
->
IsOpen
();
// TODO temp_close
//
if (!isOpen) {
//
//will be added twice! is it a problem?
//
lines.emplace_back((Line)*trans);
//
} else {
//TODO
isOpen = trans->IsOpen();
isOpen
=
!
trans
->
IsClose
();
if
(
!
isOpen
)
{
//will be added twice! is it a problem?
lines
.
emplace_back
((
Line
)
*
trans
);
}
else
{
anyDoor
=
Line
{
*
trans
};
if
(
tmpDoors
.
count
(
uidNotConst
)
==
0
)
{
tmpDoors
.
emplace
(
std
::
make_pair
(
uidNotConst
,
(
Line
)
*
trans
));
}
//
}
}
}
//find insidePoint and save it, together with UID
...
...
@@ -176,7 +177,8 @@ UnivFFviaFMTrips::UnivFFviaFMTrips(SubRoom* subRoomArg, Configuration* const con
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
{
...
...
@@ -185,13 +187,13 @@ UnivFFviaFMTrips::UnivFFviaFMTrips(SubRoom* subRoomArg, Configuration* const con
}
for
(
auto
&
trans
:
tmpTrans
)
{
uidNotConst
=
trans
->
GetUniqueID
();
//
TODO temp_close
isOpen
=
trans
->
IsOpen
();
//
if (!isOpen) {
//
lines.emplace_back((Line)*trans);
//
} else {
//
TODO isOpen = trans->IsOpen();
isOpen
=
!
trans
->
IsClose
();
if
(
!
isOpen
)
{
lines
.
emplace_back
((
Line
)
*
trans
);
}
else
{
tmpDoors
.
emplace
(
std
::
make_pair
(
uidNotConst
,
(
Line
)
*
trans
));
//
}
}
}
_building
->
GetAllGoals
();
...
...
routing/ff_router_trips/ffRouterTrips.cpp
View file @
ae146701
...
...
@@ -137,8 +137,8 @@ bool FFRouterTrips::Init(Building* building)
roomAndCroTrVector
.
clear
();
for
(
auto
&
pair
:
allTrans
)
{
// TODO temp_close
// 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
())
{
...
...
@@ -150,11 +150,12 @@ bool FFRouterTrips::Init(Building* building)
Room
*
room2
=
pair
.
second
->
GetRoom2
();
if
(
room2
)
roomAndCroTrVector
.
emplace_back
(
std
::
make_pair
(
room2
->
GetID
(),
pair
.
second
->
GetUniqueID
()));
//
}
}
}
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
();
...
...
@@ -556,14 +557,15 @@ int FFRouterTrips::FindExit1(Pedestrian* p)
if
(
!
_targetWithinSubroom
)
{
//candidates of current room (ID) (provided by Room)
for
(
auto
transUID
:
_building
->
GetRoom
(
p
->
GetRoomID
())
->
GetAllTransitionsIDs
())
{
//
TODO temp_close
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
());
}
}
...
...
@@ -573,14 +575,15 @@ int FFRouterTrips::FindExit1(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
())
{
//
TODO temp_close
if
(
transI
->
IsOpen
())
{
//
TODO if (transI->IsOpen()) {
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