JuPedSim / jpsreport

Analysis tool
https://www.jupedsim.org/jpsreport_introduction.html
Other
3 stars 9 forks source link

Using both method D and I is not safe! #73

Closed chraibi closed 5 years ago

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 4, 2019, 12:56 [origin]

In a pre-test for issue #102, I noticed the following error: Method D and I can not be used simultaneously. The data file for individual fundamental diagram in the given measurement area (Method D) is empty.

This agrees with line 187 in Analysis.cpp:

Log->Write("Warning:\t Using both method D and I is not safe!");

my test files:
ini_Uebung_02b.xml

geo_Uebung_02.xml

traj_Uebung_02b.txt

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 4, 2019, 18:08

I create a new feature branch.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 4, 2019, 18:11

Proposal for Modification of Method I based on documentation (WIP):

Method I

 <method_I enabled="true">
   <measurement_area id="1" start_frame="None" stop_frame="None" get_individual_FD="false"/>
   <cut_by_circle enabled="true" radius="1.0" edges="10"/>
 </method_I>

Possible parameters are:

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 4, 2019, 18:16

Analysis.cpp (line 158 ff):

     if(args->GetIsMethodD()) {
          _DoesUseMethodD = true;
          vector<int> Measurement_Area_IDs = args->GetAreaIDforMethodD();
          for(unsigned int i=0; i<Measurement_Area_IDs.size(); i++)
          {
               _areaForMethod_D.push_back(dynamic_cast<MeasurementArea_B*>( args->GetMeasurementArea(Measurement_Area_IDs[i])));
          }
          _StartFramesMethodD = args->GetStartFramesMethodD();
          _StopFramesMethodD = args->GetStopFramesMethodD();
          _IndividualFDFlags = args->GetIndividualFDFlags();
          _plotTimeseriesD=args->GetIsPlotTimeSeriesD();
          _geoPoly = ReadGeometry(args->GetGeometryFilename(), _areaForMethod_D);
     }
     if(args->GetIsMethodI()) {
          _DoesUseMethodI = true;
          vector<int> Measurement_Area_IDs = args->GetAreaIDforMethodI();
          for(unsigned int i=0; i<Measurement_Area_IDs.size(); i++)
          {
               _areaForMethod_I.push_back(dynamic_cast<MeasurementArea_B*>( args->GetMeasurementArea(Measurement_Area_IDs[i])));
          }
          _StartFramesMethodI = args->GetStartFramesMethodI();
          _StopFramesMethodI = args->GetStopFramesMethodI();
          _IndividualFDFlags = args->GetIndividualFDFlags();
          _plotTimeseriesI=args->GetIsPlotTimeSeriesI();
          _geoPoly = ReadGeometry(args->GetGeometryFilename(), _areaForMethod_I);
     }

     if( _DoesUseMethodD &&  _DoesUseMethodI)
     {
          Log->Write("Warning:\t Using both method D and I is not safe!");
          // because ReadGeomtry() may be called twice
     }
     _deltaF = args->GetDelatT_Vins();
     _cutByCircle = args->GetIsCutByCircle();
     _getProfile = args->GetIsGetProfile();
     _outputGraph = args->GetIsOutputGraph();
     _plotGraph = args->GetIsPlotGraph();
     _plotIndex = args->GetIsPlotIndex();
     _isOneDimensional=args->GetIsOneDimensional();
     _vComponent = args->GetVComponent();
     _IgnoreBackwardMovement =args->GetIgnoreBackwardMovement();
     _grid_size_X = int(args->GetGridSizeX());
     _grid_size_Y = int(args->GetGridSizeY());
     _geometryFileName=args->GetGeometryFilename();
     _projectRootDir=args->GetProjectRootDir();
     _trajFormat=args->GetFileFormat();
     _cutRadius=args->GetCutRadius();
     _circleEdges=args->GetCircleEdges();
     _scriptsLocation=args->GetScriptsLocation();
     _outputLocation=args->GetOutputLocation();
}

@chraibi Any ideas for a solution?

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 4, 2019, 18:23

a few comments to my note:

Compared to method D, I would reduce the input parameters. The plot function is not required. I want to get individual data with Method I. The choice is not required. So we can set the parameter _calcIndividualFDto true (see _MethodI.cpp, line 57).

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 5, 2019, 09:26

The data file rho_v_Voronoi_ (Method D) is also empty.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 13, 2019, 23:26

mentioned in merge request !20

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 13, 2019, 23:39

my solution in Analysis.h and Analysis.cpp:

I rename the variable _geoPoly to _geoPolyMethodD for Method D. For Method I, I rename the variable to _geoPolyMethodI.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 19, 2019, 16:08

closed after merge-request !20

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jun 19, 2019, 16:08

closed