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
JPSreport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
JuPedSim
JPSreport
Commits
3f1c2fb5
Verified
Commit
3f1c2fb5
authored
Feb 26, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix writing to method I
- Add surrounding room
parent
e293932f
Pipeline
#17534
passed with stages
in 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
+26
-13
Analysis.cpp
Analysis.cpp
+5
-5
geometry/Building.cpp
geometry/Building.cpp
+7
-1
methods/Method_I.cpp
methods/Method_I.cpp
+14
-7
No files found.
Analysis.cpp
View file @
3f1c2fb5
...
...
@@ -59,7 +59,7 @@
#endif
using
boost
::
geometry
::
dsv
;
using
namespace
std
;
OutputHandler
*
Log
=
new
STDIOHandler
();
...
...
@@ -204,7 +204,7 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
_building
->
LoadGeometry
(
geometryFile
.
string
());
// create the polygons
_building
->
InitGeometry
();
//
_building->AddSurroundingRoom();
_building
->
AddSurroundingRoom
();
double
geo_minX
=
FLT_MAX
;
double
geo_minY
=
FLT_MAX
;
...
...
@@ -216,6 +216,8 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
//loop over all areas
for
(
auto
&&
area
:
areas
)
{
std
::
cout
<<
"area "
<<
area
->
_id
<<
"
\n
"
;
//search for the subroom that contains that area
for
(
auto
&&
it_room
:
_building
->
GetAllRooms
())
{
...
...
@@ -252,7 +254,7 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
}
}
}
}
}
//room
if
(
geoPoly
.
count
(
area
->
_id
)
==
0
)
{
...
...
@@ -265,8 +267,6 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
_highVertexY
=
geo_maxY
;
_lowVertexX
=
geo_minX
;
_lowVertexY
=
geo_minY
;
using
boost
::
geometry
::
dsv
;
// cout<<"INFO: \tGeometry polygon is:\t" << dsv(geoPoly[1])<<endl;
return
geoPoly
;
}
...
...
geometry/Building.cpp
View file @
3f1c2fb5
...
...
@@ -265,19 +265,25 @@ void Building::AddSurroundingRoom()
x_max
=
x_max
+
10.0
;
y_min
=
y_min
-
10.0
;
y_max
=
y_max
+
10.0
;
Log
->
Write
(
"INFO:
\t
Adding surrounding room X: %f, Y: %f -- %f, %f
\n
"
,
x_min
,
x_max
,
y_min
,
y_max
);
SubRoom
*
bigSubroom
=
new
NormalSubRoom
();
bigSubroom
->
SetType
(
"Subroom"
);
bigSubroom
->
SetPlanEquation
(
0
,
0
,
1
);
//@todo: dummy values
bigSubroom
->
SetRoomID
(
_rooms
.
size
());
bigSubroom
->
SetSubRoomID
(
0
);
// should be the single subroom
bigSubroom
->
AddWall
(
Wall
(
Point
(
x_min
,
y_min
),
Point
(
x_min
,
y_max
)));
bigSubroom
->
AddWall
(
Wall
(
Point
(
x_min
,
y_max
),
Point
(
x_max
,
y_max
)));
bigSubroom
->
AddWall
(
Wall
(
Point
(
x_max
,
y_max
),
Point
(
x_max
,
y_min
)));
bigSubroom
->
AddWall
(
Wall
(
Point
(
x_max
,
y_min
),
Point
(
x_min
,
y_min
)));
vector
<
Line
*>
goals
=
vector
<
Line
*>
();
// dummy vector
bigSubroom
->
ConvertLineToPoly
(
goals
);
Room
*
bigRoom
=
new
Room
();
bigRoom
->
AddSubRoom
(
bigSubroom
);
bigRoom
->
SetCaption
(
"outside"
);
bigRoom
->
SetID
(
_rooms
.
size
());
bigRoom
->
SetZPos
(
0
);
//@todo: dummy value
AddRoom
(
bigRoom
);
_xMin
=
x_min
;
_xMax
=
x_max
;
...
...
methods/Method_I.cpp
View file @
3f1c2fb5
...
...
@@ -83,7 +83,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
_fps
=
peddata
.
GetFps
();
int
mycounter
=
0
;
int
minFrame
=
peddata
.
GetMinFrame
();
Log
->
Write
(
"INFO:
\t
Method
D
: frame rate fps: <%.2f>, start: <%d>, stop: <%d> (minFrame = %d)"
,
_fps
,
_startFrame
,
_stopFrame
,
minFrame
);
Log
->
Write
(
"INFO:
\t
Method
I
: frame rate fps: <%.2f>, start: <%d>, stop: <%d> (minFrame = %d)"
,
_fps
,
_startFrame
,
_stopFrame
,
minFrame
);
if
(
_startFrame
!=
_stopFrame
)
{
if
(
_startFrame
==-
1
)
...
...
@@ -124,6 +124,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
Log
->
Write
(
"------------------------ Analyzing with Method I -----------------------------"
);
//for(int frameNr = 0; frameNr < peddata.GetNumFrames(); frameNr++ )
//for(std::map<int , std::vector<int> >::iterator ite=_peds_t.begin();ite!=_peds_t.end();ite++)
for
(
auto
ite
:
_peds_t
)
{
int
frameNr
=
ite
.
first
;
...
...
@@ -154,10 +155,13 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
VInFrame
.
erase
(
VInFrame
.
begin
()
+
i
);
Log
->
Write
(
"Warning:
\t
Pedestrian removed"
);
i
--
;
}
}
int
NumPeds
=
IdInFrame
.
size
();
//---------------------------------------------------------------------------------------------------------------
// std::cout << "numpeds = " << NumPeds << "\n";
//---------------------------------------------------------------------------------------------------------------
if
(
_isOneDimensional
)
{
CalcVoronoiResults1D
(
XInFrame
,
VInFrame
,
IdInFrame
,
_areaForMethod_I
->
_poly
,
str_frid
);
...
...
@@ -209,11 +213,11 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
Log
->
Write
(
"WARNING:
\t
Voronoi Diagrams are not obtained!. Frame: %d (minFrame = %d)
\n
"
,
frid
,
minFrame
);
}
}
fclose
(
_fVoronoiRhoV
);
if
(
_calcIndividualFD
)
{
fclose
(
_fIndividualFD
);
}
}
//peds
fclose
(
_fVoronoiRhoV
);
if
(
_calcIndividualFD
)
{
fclose
(
_fIndividualFD
);
}
return
return_value
;
}
...
...
@@ -551,6 +555,9 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
polygon_str
.
c_str
(),
v_str
.
c_str
());
}
else
{
std
::
cout
<<
"empty interectio with the measurement aren
\n
"
;
}
temp
++
;
}
}
...
...
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