JuPedSim / jpsreport

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

Method D: swallowed obstacles #57

Closed chraibi closed 5 years ago

chraibi commented 5 years ago

In Gitlab by @gjaeger on Oct 6, 2018, 17:02 [origin]

When an obstacle is enclosed by a polygon, the obstacle disappears (see frame 270, 828, 1032, 1196, 1554, 2300 ...)

Video

inifile | geofile | trajectories

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 7, 2018, 10:42

created branch 87-method-d-swallowed-obstacles

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 7, 2018, 18:46

Looks like the obstacle becomes part of the Voronoi polygon when it's inside it. Unfortunately, we don't see this in the video above.

All black points in the video below, are part of the Voronoi diagram. The obstacle is not plotted​.

imagesequence

(Frame 264)

I think at some point the obstacle is within the Voronoi polygon. So the intersection is equal to the obstacle.

This case should be treated properly in the code.

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 7, 2018, 19:14

More debugging gives Screen_Shot_2018-10-07_at_19.13.35

boost.cpp

Boost-intersection function used in VoronoiDiagram::cutPolygonsWithGeometry() should be used carefully to handle this special case.

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 8, 2018, 14:01

The resulting Voronoi polygons we get in this case are correct.

In case the obstacle is within the polygon, the resulting area (density) equals the area of the "outer ring" minus the area of the obstacle.

For example Agent 9, frame 264

Polygon  Area:  1.7460135175399998
Obstacle Area:  0.3599999999999999
Contour  Area:  2.106013517539999
Coutour - Obstacle = Polygon? True

(results produced by this debug_jpsreport_polygons.ipynb)

So, the issue here is related to the plot-functions rather than to the density calculations in jpsreport.

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 9, 2018, 16:25

mentioned in commit 361cffdd936bdc3a2827dea7c94f1aa6b6564b6f

chraibi commented 5 years ago

In Gitlab by @gjaeger on Oct 9, 2018, 17:55

So, the issue here is related to the plot-functions rather than to the density calculations in jpsreport.

The problem relates to the changes in the function GetIndividualID (issue #84 - commit 71ffd53d).

The old visualization:

crossing_90_c_01_Method_D_0264_old

It works with the changes in the commit 361cffdd. The IndividualFD file contains the polygon (agent 9, frame 264):

'(((18689.432962, 5902.734277), (13923.830031, 9365.147512), (12217.312063, 14617.269838), (17318.921697, 23587.530984), (18923.830077, 24753.565170), (25104.169957, 24753.565159), (30104.169948, 21120.852517), (30809.715140, 18949.407693), (18689.432962, 5902.734277), (17000.000000, 17000.000000), (23000.000000, 17000.000000), (23000.000000, 23000.000000), (17000.000000, 23000.000000), (17000.000000, 17000.000000)))'

The polygontraj file contains the same polygon (agent 9, frame 264):

'9 | (((1.86894, 0.590273), (1.39238, 0.936515), (1.22173, 1.46173), (1.73189, 2.35875), (1.89238, 2.47536), (2.51042, 2.47536), (3.01042, 2.11209), (3.08097, 1.89494), (1.86894, 0.590273)), ((1.7, 1.7), (2.3, 1.7), (2.3, 2.3), (1.7, 2.3), (1.7, 1.7)))\n'

with commit 361cffdd: crossing_90_c_01_Method_D_0264_new

It looks good for the whole analysis: crossing_90

I think, my plot-function is not wrong. :smile:

chraibi commented 5 years ago

In Gitlab by @gjaeger on Oct 9, 2018, 18:03

My initial question would be clarified. We can close this issue.

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 9, 2018, 18:05

Your plots function is correct.

Besides, I like the "pacman"-effect we see in your last video. :sweat_smile:

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 9, 2018, 18:06

closed

chraibi commented 5 years ago

In Gitlab by @chraibi on Oct 9, 2018, 18:49

mentioned in commit 3dc868aea0916d7185247da310b20e0c5fac3da6