Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
JPSreport
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JuPedSim
JPSreport
Commits
641c1bd8
Commit
641c1bd8
authored
6 years ago
by
Mohcine Chraibi
Browse files
Options
Downloads
Patches
Plain Diff
use python3 to fix #85
- Add a routine to convert a polygon to string. Could be useful.
parent
77f10002
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Analysis.cpp
+2
-2
2 additions, 2 deletions
Analysis.cpp
methods/Method_D.cpp
+26
-5
26 additions, 5 deletions
methods/Method_D.cpp
with
28 additions
and
7 deletions
Analysis.cpp
+
2
−
2
View file @
641c1bd8
...
...
@@ -357,7 +357,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path)
Log
->
Write
(
"INFO:
\t
Success with Method C using measurement area id %d!
\n
"
,
_areaForMethod_C
[
i
]
->
_id
);
if
(
_plotTimeseriesC
[
i
])
{
string
parameters_Timeseries
=
"python
\"
"
+
_scriptsLocation
+
"/_Plot_timeseries_rho_v.py
\"
-p
\"
"
+
_projectRootDir
+
VORO_LOCATION
+
"
\"
-n "
+
filename
+
string
parameters_Timeseries
=
"python
3
\"
"
+
_scriptsLocation
+
"/_Plot_timeseries_rho_v.py
\"
-p
\"
"
+
_projectRootDir
+
VORO_LOCATION
+
"
\"
-n "
+
filename
+
" -f "
+
boost
::
lexical_cast
<
std
::
string
>
(
data
.
GetFps
());
int
res
=
system
(
parameters_Timeseries
.
c_str
());
Log
->
Write
(
"INFO:
\t
time series result: %d "
,
res
);
...
...
@@ -401,7 +401,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path)
std
::
cout
<<
"INFO:
\t
Success with Method D using measurement area id "
<<
_areaForMethod_D
[
i
]
->
_id
<<
"
\n
"
;
if
(
_plotTimeseriesD
[
i
])
{
string
parameters_Timeseries
=
"python
\"
"
+
_scriptsLocation
+
"/_Plot_timeseries_rho_v.py
\"
-p
\"
"
+
_projectRootDir
+
VORO_LOCATION
+
"
\"
-n "
+
filename
+
string
parameters_Timeseries
=
"python
3
\"
"
+
_scriptsLocation
+
"/_Plot_timeseries_rho_v.py
\"
-p
\"
"
+
_projectRootDir
+
VORO_LOCATION
+
"
\"
-n "
+
filename
+
" -f "
+
boost
::
lexical_cast
<
std
::
string
>
(
data
.
GetFps
());
int
res
=
system
(
parameters_Timeseries
.
c_str
());
Log
->
Write
(
"INFO:
\t
time series result: %d "
,
res
);
...
...
This diff is collapsed.
Click to expand it.
methods/Method_D.cpp
+
26
−
5
View file @
641c1bd8
...
...
@@ -37,8 +37,23 @@
//using std::ofstream;
using
namespace
std
;
std
::
string
polygon_to_string
(
const
polygon_2d
&
polygon
)
{
string
polygon_str
=
"("
;
for
(
auto
point
:
boost
::
geometry
::
exterior_ring
(
polygon
)
)
{
double
x
=
boost
::
geometry
::
get
<
0
>
(
point
);
double
y
=
boost
::
geometry
::
get
<
1
>
(
point
);
polygon_str
.
append
(
"("
);
polygon_str
.
append
(
std
::
to_string
(
x
));
polygon_str
.
append
(
", "
);
polygon_str
.
append
(
std
::
to_string
(
y
));
polygon_str
.
append
(
"), "
);
}
polygon_str
.
pop_back
();
polygon_str
.
pop_back
();
//remove last komma
polygon_str
.
append
(
")"
);
return
polygon_str
;
}
Method_D
::
Method_D
()
{
_grid_size_X
=
0.10
;
...
...
@@ -460,9 +475,9 @@ void Method_D::OutputVoroGraph(const string & frameId, std::vector<std::pair<po
if
(
_plotVoronoiCellData
)
{
string
parameters_rho
=
"python "
+
_scriptsLocation
+
"/_Plot_cell_rho.py -f
\"
"
+
voronoiLocation
+
"
\"
-n "
+
_trajName
+
"_id_"
+
_measureAreaId
+
"_"
+
frameId
+
string
parameters_rho
=
"python
3
"
+
_scriptsLocation
+
"/_Plot_cell_rho.py -f
\"
"
+
voronoiLocation
+
"
\"
-n "
+
_trajName
+
"_id_"
+
_measureAreaId
+
"_"
+
frameId
+
" -g "
+
_geometryFileName
+
" -p "
+
_trajectoryPath
;
string
parameters_v
=
"python "
+
_scriptsLocation
+
"/_Plot_cell_v.py -f
\"
"
+
voronoiLocation
+
"
\"
-n "
+
_trajName
+
"_id_"
+
_measureAreaId
+
"_"
+
frameId
+
string
parameters_v
=
"python
3
"
+
_scriptsLocation
+
"/_Plot_cell_v.py -f
\"
"
+
voronoiLocation
+
"
\"
-n "
+
_trajName
+
"_id_"
+
_measureAreaId
+
"_"
+
frameId
+
" -g "
+
_geometryFileName
+
" -p "
+
_trajectoryPath
;
if
(
_plotVoronoiIndex
)
...
...
@@ -490,10 +505,16 @@ void Method_D::GetIndividualFD(const vector<polygon_2d>& polygon, const vector<d
polygon_list
v
;
intersection
(
measureArea
,
polygon_iterator
,
v
);
if
(
!
v
.
empty
())
{
string
polygon_str
=
polygon_to_string
(
polygon_iterator
);
uniquedensity
=
1.0
/
(
area
(
polygon_iterator
)
*
CMtoM
*
CMtoM
);
uniquevelocity
=
Velocity
[
temp
];
uniqueId
=
Id
[
temp
];
fprintf
(
_fIndividualFD
,
"%s
\t
%d
\t
%.3f
\t
%.3f
\n
"
,
frid
.
c_str
(),
uniqueId
,
uniquedensity
,
uniquevelocity
);
std
::
cout
<<
"STR: "
<<
polygon_str
<<
"
\n
"
;
std
::
cout
<<
"
\n
"
<<
dsv
(
polygon_iterator
)
<<
"
\n
---- "
<<
std
::
endl
;
// std::cout << dsv(measureArea) << "\n ---- " << std::endl;
// std::cout << dsv(v[0]) << "\n ---- " << std::endl;
getc
(
stdin
);
}
temp
++
;
}
...
...
This diff is collapsed.
Click to expand it.
Mohcine Chraibi
@chraibi1
mentioned in commit
2dfb2f32
·
6 years ago
mentioned in commit
2dfb2f32
mentioned in commit 2dfb2f3279afb23570516bb715d555f24f4a525b
Toggle commit list
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment