Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
JuPedSim
JPScore
Commits
277817e3
Commit
277817e3
authored
Apr 12, 2019
by
tobias schroedter
Browse files
Merge branch '294-events' into develop
parents
83393342
051c7c11
Pipeline
#19388
passed with stages
in 10 minutes and 22 seconds
Changes
11
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Simulation.cpp
View file @
277817e3
...
...
@@ -546,6 +546,11 @@ double Simulation::RunBody(double maxSimTime)
}
}
// here the used routers are update, when needed due to external changes
if
(
_routingEngine
->
NeedsUpdate
()){
_routingEngine
->
UpdateRouter
();
}
//update the routes and locations
UpdateRoutesAndLocations
();
...
...
events/EventManager.cpp
View file @
277817e3
...
...
@@ -25,7 +25,6 @@
*
**/
#include
<string>
#include
<cstdlib>
#include
<iostream>
...
...
@@ -537,6 +536,7 @@ void EventManager::ProcessEvent()
TempCloseDoor
(
event
.
GetId
());
break
;
}
_building
->
GetRoutingEngine
()
->
setNeedUpdate
(
true
);
}
}
...
...
events/EventManager.h
View file @
277817e3
...
...
@@ -31,7 +31,6 @@
class
Building
;
class
Router
;
class
GlobalRouterTrips
;
class
QuickestPathRouter
;
class
RoutingEngine
;
class
Event
;
...
...
routing/Router.cpp
View file @
277817e3
...
...
@@ -98,3 +98,7 @@ void Router::SetTrips(const Trips& trips){
_trips
=
trips
;
std
::
cout
<<
_trips
<<
std
::
endl
;
}
void
Router
::
Update
(){
}
\ No newline at end of file
routing/Router.h
View file @
277817e3
...
...
@@ -142,7 +142,11 @@ public:
void
SetTrips
(
const
Trips
&
trips
);
/**
* Update the router, when geometry changed due to external changes.
* Remark: Depends on router if needed!
*/
virtual
void
Update
();
};
#endif
/* _ROUTING_H */
routing/RoutingEngine.cpp
View file @
277817e3
...
...
@@ -131,3 +131,21 @@ bool RoutingEngine::Init(Building* building)
return
status
;
}
bool
RoutingEngine
::
NeedsUpdate
()
const
{
return
_needUpdate
;
}
void
RoutingEngine
::
setNeedUpdate
(
bool
needUpdate
)
{
_needUpdate
=
needUpdate
;
}
void
RoutingEngine
::
UpdateRouter
()
{
for
(
auto
*
router
:
_routersCollection
){
router
->
Update
();
}
_needUpdate
=
false
;
}
routing/RoutingEngine.h
View file @
277817e3
...
...
@@ -107,12 +107,29 @@ public:
*/
bool
Init
(
Building
*
building
);
/**
* Returns if routers need to be updated
* @return routers need to be updated
*/
bool
NeedsUpdate
()
const
;
/**
* Set if routers need to be updated
* @param needUpdate
*/
void
setNeedUpdate
(
bool
needUpdate
);
/**
* Updates all used routers
*/
void
UpdateRouter
();
private:
/// collections of all routers used
std
::
vector
<
Router
*>
_routersCollection
;
/// collection of all trips/routes
Trips
_tripsCollection
;
bool
_needUpdate
=
false
;
};
#endif
/* ROUTINGENGINE_H_ */
routing/ff_router/ffRouter.cpp
View file @
277817e3
...
...
@@ -640,4 +640,8 @@ bool FFRouter::MustReInit() {
void
FFRouter
::
SetRecalc
(
double
t
)
{
_timeToRecalc
=
t
+
_recalc_interval
;
}
void
FFRouter
::
Update
(){
this
->
ReInit
();
}
\ No newline at end of file
routing/ff_router/ffRouter.h
View file @
277817e3
...
...
@@ -184,6 +184,8 @@ public:
bool
MustReInit
();
void
SetRecalc
(
double
t
);
virtual
void
Update
();
private:
protected:
...
...
routing/ff_router_trips/ffRouterTrips.cpp
View file @
277817e3
...
...
@@ -706,4 +706,8 @@ bool FFRouterTrips::MustReInit() {
void
FFRouterTrips
::
SetRecalc
(
double
t
)
{
_timeToRecalc
=
t
+
_recalc_interval
;
}
void
FFRouterTrips
::
Update
(){
this
->
ReInit
();
}
\ No newline at end of file
routing/ff_router_trips/ffRouterTrips.h
View file @
277817e3
...
...
@@ -194,6 +194,8 @@ public:
bool
MustReInit
();
void
SetRecalc
(
double
t
);
virtual
void
Update
();
private:
protected:
...
...
tobias schroedter
@schroedter1
mentioned in issue
#294 (closed)
·
Apr 12, 2019
mentioned in issue
#294 (closed)
mentioned in issue #294
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment