JuPedSim / jpsreport

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

IndividualFD file use wrong PersID #66

Closed chraibi closed 5 years ago

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jan 27, 2019, 18:28 [origin]

It looks like the IndividualFD file does not take into account the PersID from the trajectory file.

chraibi commented 5 years ago

In Gitlab by @chraibi on Jan 28, 2019, 16:42

More input please. Thanks!

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jan 28, 2019, 21:34

The trajectory file contains no consecutive PersID. jpsreport saves consecutive IDs.

PersID in trajectory file (traj_uo-300-300-120_exp_extracted.txt):

[  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,
        14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,
        27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
        40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,
        53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,  64,  65,
        66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,
        79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,
        92,  93,  94,  95,  96,  98,  99, 100, 118]

PersID in IndividualFD file (traj_uo-300-300-120_exp_extracted.txt_id_1.dat.zip):

[  1,   2,   4,   3,   5,  14,   7,  11,   6,   9,   8,  12,  15,
        10,  22,  13,  17,  19,  21,  32,  16,  18,  26,  24,  23,  20,
        27,  25,  29,  28,  30,  33,  31,  34,  35,  42,  40,  38,  39,
        37,  36,  51,  41,  56,  47,  58,  52,  43,  46,  48,  44,  45,
        49,  50,  63,  54,  55,  53,  75,  61,  67,  57,  68,  62,  64,
        59,  66,  60,  72,  65,  69,  73,  70,  71,  77,  86,  91,  76,
        74,  78,  83,  79,  80,  81,  84,  92,  87,  82,  89,  85,  88,
        96,  94,  90,  97,  98,  99,  93,  95, 100]

ini_UO-300-300-120_exp_extracted.xml, geo_UO_300-300-120.xml

chraibi commented 5 years ago

In Gitlab by @gjaeger on Jan 30, 2019, 23:09

In the file PedData.cpp, I found the following lines (see L 231)

     //Total number of agents
     std::vector<int> unique_ids = _IdsTXT;
     // no need to
     //sort. Assume that ids are ascendant
     sort(unique_ids.begin(), unique_ids.end());
     std::vector<int>::iterator it;
     it = unique(unique_ids.begin(), unique_ids.end());
     unique_ids.resize(distance(unique_ids.begin(),it));
     _numPeds = unique_ids.size();
     Log->Write("INFO: Total number of Agents: %d", _numPeds);
     CreateGlobalVariables(_numPeds, _numFrames);
     Log->Write("INFO: Create Global Variables done");

@chraibi Is this assumption the reason for my observation? I would get the IDs. Then I would create a list from it and continue to work with it.

chraibi commented 5 years ago

In Gitlab by @chraibi on Jan 31, 2019, 11:06

@gjaeger The goal of this snippet is just to determine the _numPeds

Maybe in C++17 there is a more elegant way to do it than this, but your assumption is right:

Line 283

Line 320

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 4, 2019, 11:29

@chraibi: The short trajectory file for you.

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 4, 2019, 11:32

@chraibi: The results of this morning: 3895e194aa3761f58dd068d44286c0dbc89f8c53

chraibi commented 5 years ago

In Gitlab by @gjaeger on Feb 11, 2019, 10:03

assigned to @chraibi

chraibi commented 5 years ago

In Gitlab by @chraibi on Mar 3, 2019, 19:35

mentioned in merge request !15

chraibi commented 5 years ago

In Gitlab by @chraibi on Mar 3, 2019, 19:37

mentioned in commit 0fa81773950c35a373ad31ad5cb11303446b6cb1

chraibi commented 5 years ago

In Gitlab by @chraibi on Mar 3, 2019, 19:37

closed via merge request !15

chraibi commented 5 years ago

In Gitlab by @chraibi on Mar 3, 2019, 19:38

changed title from {-Method D | -}IndividualFD file use wrong PersID to IndividualFD file use wrong PersID