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
a3ec1420
Commit
a3ec1420
authored
Apr 25, 2018
by
tobias schroedter
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pedestrians leaving/removed should now only be counted once. Solving
issue 3 (show statistics from GitHub).
parent
c5f458f6
Pipeline
#9034
failed with stages
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
Simulation.cpp
Simulation.cpp
+11
-11
No files found.
Simulation.cpp
View file @
a3ec1420
...
...
@@ -286,8 +286,8 @@ void Simulation::UpdateRoutesAndLocations()
{
//pedestrians to be deleted
//you should better create this in the constructor and allocate it once.
vector
<
Pedestrian
*>
pedsToRemove
;
pedsToRemove
.
reserve
(
500
);
//just reserve some space
set
<
Pedestrian
*>
pedsToRemove
;
//
pedsToRemove.reserve(500); //just reserve some space
// collect all pedestrians in the simulation.
const
vector
<
Pedestrian
*>&
allPeds
=
_building
->
GetAllPedestrians
();
...
...
@@ -305,12 +305,12 @@ void Simulation::UpdateRoutesAndLocations()
&&
(
room
->
GetCaption
()
==
"outside"
))
{
#pragma omp critical(Simulation_Update_pedsToRemove)
pedsToRemove
.
push_back
(
ped
);
pedsToRemove
.
insert
(
ped
);
}
else
if
((
ped
->
GetFinalDestination
()
!=
FINAL_DEST_OUT
)
&&
(
goals
.
at
(
ped
->
GetFinalDestination
())
->
Contains
(
ped
->
GetPos
())))
{
#pragma omp critical(Simulation_Update_pedsToRemove)
pedsToRemove
.
push_back
(
ped
);
pedsToRemove
.
insert
(
ped
);
}
// reposition in the case the pedestrians "accidently left the room" not via the intended exit.
...
...
@@ -326,8 +326,7 @@ void Simulation::UpdateRoutesAndLocations()
if
(
!
assigned
)
{
#pragma omp critical(Simulation_Update_pedsToRemove)
pedsToRemove
.
push_back
(
ped
);
//the agent left the old room
pedsToRemove
.
insert
(
ped
);
//the agent left the old room
//actualize the eggress time for that room
#pragma omp critical(SetEgressTime)
allRooms
.
at
(
ped
->
GetRoomID
())
->
SetEgressTime
(
ped
->
GetGlobalTime
());
...
...
@@ -343,7 +342,7 @@ void Simulation::UpdateRoutesAndLocations()
ped
->
Relocate
(
f
);
//exit(EXIT_FAILURE);
#pragma omp critical(Simulation_Update_pedsToRemove)
pedsToRemove
.
push_back
(
ped
);
pedsToRemove
.
insert
(
ped
);
}
}
...
...
@@ -356,10 +355,11 @@ void Simulation::UpdateRoutesAndLocations()
else
#endif
{
// remove the pedestrians that have left the building
for
(
unsigned
int
p
=
0
;
p
<
pedsToRemove
.
size
();
p
++
)
{
UpdateFlowAtDoors
(
*
p
edsToRemove
[
p
]
);
_building
->
DeletePedestrian
(
p
edsToRemove
[
p
]
);
for
(
auto
p
:
pedsToRemove
)
{
Mohcine Chraibi
@chraibi1
·
Apr 27, 2018
Owner
👍
:+1:
Please
register
or
sign in
to reply
UpdateFlowAtDoors
(
*
p
);
_building
->
DeletePedestrian
(
p
);
}
pedsToRemove
.
clear
();
}
...
...
@@ -605,7 +605,7 @@ void Simulation::UpdateFlowAtDoors(const Pedestrian& ped) const
}
}
//#pragma omp critical
trans
->
IncreaseDoorUsage
(
1
,
ped
.
GetGlobalTime
());
trans
->
IncreaseDoorUsage
(
1
,
ped
.
GetGlobalTime
()
,
ped
.
GetID
()
);
}
}
}
...
...
anna braun
@tscherniewski1
mentioned in issue
#272 (closed)
·
Apr 26, 2018
mentioned in issue
#272 (closed)
mentioned in issue #272
Toggle commit list
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