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
f2066beb
Verified
Commit
f2066beb
authored
Jun 13, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to ReInit router
geometries may change during simulation
parent
268285f1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
33 deletions
+65
-33
Simulation.cpp
Simulation.cpp
+27
-33
routing/ff_router/ffRouter.cpp
routing/ff_router/ffRouter.cpp
+38
-0
No files found.
Simulation.cpp
View file @
f2066beb
...
...
@@ -575,11 +575,8 @@ double Simulation::RunBody(double maxSimTime)
//here we could place router-tasks (calc new maps) that can use multiple cores AND we have 't'
//update quickestRouter
if
(
_routingEngine
.
get
()
->
GetRouter
(
ROUTING_FF_QUICKEST
))
{
if
(
geometryChanged
)
{
FFRouter
*
ffrouter2
=
dynamic_cast
<
FFRouter
*>
(
_routingEngine
.
get
()
->
GetRouter
(
ROUTING_FF_QUICKEST
));
ffrouter2
->
Init
(
_building
.
get
());
// debug
fs
::
path
f
(
"tmp_"
+
std
::
to_string
(
t
)
+
"_"
+
_config
->
GetGeometryFile
());
std
::
string
filename
=
f
.
string
();
...
...
@@ -597,21 +594,18 @@ double Simulation::RunBody(double maxSimTime)
dirlocff
->
Init
(
_building
.
get
(),
_deltaH
,
_wallAvoidDistance
,
_useWallAvoidance
);
Log
->
Write
(
"INFO:
\t
Init DirectionLOCALFloorfield done"
);
}
std
::
cout
<<
KBLU
<<
" Init router in simulation
\n
"
<<
RESET
;
}
else
{
else
{
// quickest needs update even if NeedsUpdate() is false
FFRouter
*
ffrouter
=
dynamic_cast
<
FFRouter
*>
(
_routingEngine
.
get
()
->
GetRouter
(
ROUTING_FF_QUICKEST
));
if
(
ffrouter
->
MustReInit
())
{
ffrouter
->
ReInit
();
ffrouter
->
SetRecalc
(
t
);
}
}
}
// here the used routers are update, when needed due to external changes
if
(
_routingEngine
->
NeedsUpdate
()){
std
::
cout
<<
KBLU
<<
" Init router in simulation
\n
"
<<
RESET
;
_routingEngine
->
UpdateRouter
();
}
...
...
routing/ff_router/ffRouter.cpp
View file @
f2066beb
...
...
@@ -322,6 +322,44 @@ bool FFRouter::ReInit()
_distMatrix
.
clear
();
_pathsMatrix
.
clear
();
// Geommetry may change dure to trains or whatever happens in the future
//get all door UIDs
_allDoorUIDs
.
clear
();
_TransByUID
.
clear
();
_ExitsByUID
.
clear
();
_CroTrByUID
.
clear
();
auto
&
allTrans
=
_building
->
GetAllTransitions
();
auto
&
allCross
=
_building
->
GetAllCrossings
();
std
::
vector
<
std
::
pair
<
int
,
int
>>
roomAndCroTrVector
;
roomAndCroTrVector
.
clear
();
for
(
auto
&
pair
:
allTrans
)
{
//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
())
{
_ExitsByUID
.
insert
(
std
::
make_pair
(
pair
.
second
->
GetUniqueID
(),
pair
.
second
));
}
Room
*
room1
=
pair
.
second
->
GetRoom1
();
if
(
room1
)
roomAndCroTrVector
.
emplace_back
(
std
::
make_pair
(
room1
->
GetID
(),
pair
.
second
->
GetUniqueID
()));
Room
*
room2
=
pair
.
second
->
GetRoom2
();
if
(
room2
)
roomAndCroTrVector
.
emplace_back
(
std
::
make_pair
(
room2
->
GetID
(),
pair
.
second
->
GetUniqueID
()));
}
}
for
(
auto
&
pair
:
allCross
)
{
//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
();
if
(
room1
)
roomAndCroTrVector
.
emplace_back
(
std
::
make_pair
(
room1
->
GetID
(),
pair
.
second
->
GetUniqueID
()));
}
}
//make unique
std
::
sort
(
_allDoorUIDs
.
begin
(),
_allDoorUIDs
.
end
());
_allDoorUIDs
.
erase
(
std
::
unique
(
_allDoorUIDs
.
begin
(),
_allDoorUIDs
.
end
()),
_allDoorUIDs
.
end
());
// alldoorUIDs reinit
//init, yet no distances, only create map entries
for
(
auto
&
id1
:
_allDoorUIDs
)
{
for
(
auto
&
id2
:
_allDoorUIDs
){
...
...
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