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
884e4632
Verified
Commit
884e4632
authored
May 20, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct distance calculation for train doors
parent
47b8067e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
Simulation.cpp
Simulation.cpp
+2
-2
routing/DirectionStrategy.cpp
routing/DirectionStrategy.cpp
+14
-2
No files found.
Simulation.cpp
View file @
884e4632
...
...
@@ -675,7 +675,7 @@ double Simulation::RunBody(double maxSimTime)
Trans
->
UpdateClosingTime
(
_deltaT
);
if
(
Trans
->
GetClosingTime
()
<=
_deltaT
){
Trans
->
changeTemporaryState
();
Log
->
Write
(
"INFO:
\t
Reset state of door %d, Time=%.2f"
,
Trans
->
GetID
(),
Pedestrian
::
GetGlobalTime
());
/* Log-> Write("INFO:\tReset state of door %d, Time=%.2f", Trans->GetID(), Pedestrian::GetGlobalTime()); */
}
}
// normal transition
}
...
...
@@ -690,7 +690,7 @@ double Simulation::RunBody(double maxSimTime)
if
(
Trans
->
IsInLineSegment
(
tp1
)
&&
Trans
->
IsInLineSegment
(
tp2
))
{
Trans
->
SetMaxDoorUsage
(
TrainTypes
[
train
]
->
nmax
);
//
SetOutflowRate() in initialisation phase
//
todo: SetOutflowRate() to sum of doors of train
Trans
->
Open
();
}
}
...
...
routing/DirectionStrategy.cpp
View file @
884e4632
...
...
@@ -847,7 +847,8 @@ Point DirectionTrain::GetTarget(Room* room, Pedestrian* ped) const
auto
TrainTypes
=
ped
->
GetBuilding
()
->
GetTrainTypes
();
auto
TrainTimeTables
=
ped
->
GetBuilding
()
->
GetTrainTimeTables
();
auto
now
=
ped
->
GetGlobalTime
();
string
type_delme
=
""
;
// std::cout << ">>> Enter with ped at " << ped->GetPos().toString().c_str() << "\n";
for
(
auto
&&
t
:
TrainTimeTables
)
{
if
(
ped
->
GetRoomID
()
!=
t
.
second
->
rid
)
continue
;
...
...
@@ -862,15 +863,26 @@ Point DirectionTrain::GetTarget(Room* room, Pedestrian* ped) const
i
++
;
const
Point
&
d1
=
door
.
GetPoint1
();
const
Point
&
d2
=
door
.
GetPoint2
();
double
dist
=
(
d1
*
0.5
+
d2
*
0.5
).
Norm
();
const
Point
&
c
=
(
d1
+
d2
)
*
0.5
;
double
dist
=
(
ped
->
GetPos
()
-
c
).
Norm
();
// std::cout << "door id: " << door.GetID()<< " dist: " << dist<< "\n";
if
(
dist
<=
dist_min
)
{
dist_min
=
dist
;
imin
=
i
;
type_delme
=
t
.
second
->
type
;
// std::cout << " > imin " << imin << " mindist " << dist_min << "\n";
}
}
// doors
p1
=
doors
[
imin
].
GetPoint1
();
p2
=
doors
[
imin
].
GetPoint2
();
// std::cout << "\n>>> train: now " << now << ", type: " << type_delme.c_str() << "\n";
// std::cout << ">>> p1=" << p1.toString().c_str() << ". p2=" << p2.toString().c_str()<< "\n";
// std::cout << ">>> ped at " << ped->GetPos().toString().c_str() << "\n";
// getc(stdin);
}
// if time in
}
...
...
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