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
06fd3b32
Commit
06fd3b32
authored
Dec 28, 2017
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Consider schedules in source creation (
#258
)
parent
6c7fd1c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pedestrian/AgentsSourcesManager.cpp
pedestrian/AgentsSourcesManager.cpp
+9
-2
No files found.
pedestrian/AgentsSourcesManager.cpp
View file @
06fd3b32
...
...
@@ -79,7 +79,7 @@ void AgentsSourcesManager::Run()
//it might be better to use a timer
_isCompleted
=
false
;
bool
finished
=
false
;
long
updateFrequency
=
1
;
long
updateFrequency
=
1
;
//TODO parse this from inifile
do
{
//@todo: break if max simulation time is reached.
int
current_time
=
(
int
)
Pedestrian
::
GetGlobalTime
();
...
...
@@ -99,9 +99,11 @@ void AgentsSourcesManager::Run()
bool
AgentsSourcesManager
::
ProcessAllSources
()
const
{
bool
empty
=
true
;
double
current_time
=
Pedestrian
::
GetGlobalTime
();
std
::
cout
<<
"
\n
-- current time: "
<<
current_time
<<
std
::
endl
;
for
(
const
auto
&
src
:
_sources
)
{
if
(
src
->
GetPoolSize
()
)
if
(
src
->
GetPoolSize
()
&&
(
src
->
GetPlanTime
()
<=
current_time
)
)
// maybe diff<eps
{
vector
<
Pedestrian
*>
peds
;
src
->
RemoveAgentsFromPool
(
peds
,
src
->
GetFrequency
());
...
...
@@ -111,9 +113,14 @@ bool AgentsSourcesManager::ProcessAllSources() const
//todo: here every pedestrian needs an exitline
if
(
!
ComputeBestPositionVoronoiBoost
(
src
.
get
(),
peds
,
_building
)
)
Log
->
Write
(
"WARNING:
\t
There was no place for some pedestrians"
);
AgentsQueueIn
::
Add
(
peds
);
empty
=
false
;
src
->
Dump
();
}
if
(
src
->
GetPlanTime
()
>
current_time
)
// for the case we still expect
// agents coming
empty
=
false
;
//src->Dump();//exit(0);
}
return
empty
;
...
...
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