JuPedSim / jpsreport

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

Method D | number of the pedestrian is small #67

Closed chraibi closed 5 years ago

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 4, 2019, 14:38 [origin]

if(NumPeds>3)
          {
               if(_isOneDimensional)
               {
                    CalcVoronoiResults1D(XInFrame, VInFrame, IdInFrame, _areaForMethod_D->_poly,str_frid);
               }
               else
               {
                    if(IsPointsOnOneLine(XInFrame, YInFrame))
                    {
                         if(fabs(XInFrame[1]-XInFrame[0])<dmin)
                         {
                              XInFrame[1]+= offset;
                         }
                         else
                         {
                              YInFrame[1]+= offset;
                         }
                    }
                    std::vector<std::pair<polygon_2d, int> > polygons_id = GetPolygons(XInFrame, YInFrame, VInFrame, IdInFrame);
                    // std::cout << ">> polygons_id " << polygons_id.size() << "\n";
                    vector<polygon_2d> polygons;
                    for (auto p: polygons_id)
                         polygons.push_back(p.first);

                    if(!polygons.empty())
                    {
                         OutputVoronoiResults(polygons, str_frid, VInFrame); // TODO polygons_id
                         if(_calcIndividualFD)
                         {
                              if(!_isOneDimensional)
                              {
                                   GetIndividualFD(polygons,VInFrame, IdInFrame, _areaForMethod_D->_poly, str_frid); // TODO polygons_id
                              }
                         }
                         if(_getProfile)
                         { //   field analysis
                              GetProfiles(str_frid, polygons, VInFrame); // TODO polygons_id
                         }
                         if(_outputVoronoiCellData)
                         { // output the Voronoi polygons of a frame
                              OutputVoroGraph(str_frid, polygons_id, NumPeds, XInFrame, YInFrame,VInFrame);
                         }
                    }
                    else
                    {
                         for(int i=0;i<(int)IdInFrame.size();i++)
                         {
                              std::cout << XInFrame[i]*CMtoM << "   " << YInFrame[i]*CMtoM <<  "   "  << IdInFrame[i] << "\n";
                         }
                         Log->Write("WARNING: \tVoronoi Diagrams are not obtained!. Frame: %d (minFrame = %d)\n", frid, minFrame);
                    }
               }
          } // if N >3
          else
          {
               Log->Write("INFO: \tThe number of the pedestrians is small (%d). Frame = %d (minFrame = %d)\n", NumPeds, frid, minFrame);
          }

see Method_D.cpp, line 216

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 4, 2019, 19:50

Why is there the limit of three agents? (NumPeds>3)

chraibi commented 5 years ago

In Gitlab by @chraibi on Feb 4, 2019, 21:09

Because it's not possible to calculate a Voronoi Diagram with 2 points or less.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 5, 2019, 11:54

In other words: Why is the number limited if we limit the cell with the parameter cut_by_circle?

chraibi commented 5 years ago

In Gitlab by @chraibi on Feb 6, 2019, 10:33

This parameter is to limit the cell. But this cell can not be calculated with 2 points or less.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 6, 2019, 10:58

But this cell can not be calculated with 2 points or less.

Why do we need the Voronoi method in this case?

chraibi commented 5 years ago

In Gitlab by @chraibi on Feb 6, 2019, 11:05

In the trivial case, where only 1 or 2 pedestrians are in the scenario, we can't calculate a Voronoi cell.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 6, 2019, 11:21

In the trivial case, we lose a few frames. This is bad. We can't use it to analyze a solo run.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 7, 2019, 09:50

Further consideration in issue #96 (Method I).

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 7, 2019, 09:50

closed