MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Bugfix - create road map path for agents in collision #118

Closed curds01 closed 5 years ago

curds01 commented 5 years ago

The process of finding a path on a roadmap for an agent consists of finding "visible" links from the agent position to a road map vertex. The visibility query w.r.t. a single obstacle essentially tests for intersection between the obstacle's line segment and a capsule formed by the desired link (agent position to vertex position) convolved with a disk of the agent's radius. For a given vertex, if any obstacle intersects the vertex is not "visible". If the agent is intersecting an obstacle, no vertex will be considered visible.

The fix:

  1. Add new query to SpatialQuery; linkIsTraversible(). It is closely related to the queryVsibility() method with one extra detail; it handles the case where the agent is intersecting an obstacle.
  2. Extend the API through the two implementations of the interface (the nav mesh implementation is not implemented at all.) The kd-tree implementaiton is, essentially, a copy of the visibility query with the last test modified.
  3. Change the calls in the roadmap from visibility to traversibility.
  4. Add some stray clarifying comments.
  5. Remove asserts and replace them with more appropriate exceptions.

NOTE: tragically, the test framework is not sufficiently solid to admit the easy inclusion of unit tests on this. :(

Resolves #116


This change is Reviewable

curds01 commented 5 years ago

+@douglasbandeiraivo Would you be willing to review this for me?

If you're willing, I'd recommend using the Reviewable link above -- it's a better tool for doing code review.

douglasbandeiraivo commented 5 years ago

I don't think I'm prepared enouth to review and validade your code.

Em qui, 4 de abr de 2019 às 23:26, curds01 notifications@github.com escreveu:

+@douglasbandeiraivo https://github.com/douglasbandeiraivo Would you be willing to review this for me?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MengeCrowdSim/Menge/pull/118#issuecomment-480127474, or mute the thread https://github.com/notifications/unsubscribe-auth/AMvN04E6mKdB1Gk_7nWlnb80zzb8vvqjks5vdrRUgaJpZM4cUyE- .

-- Atenciosamente,

Douglas Bandeira Ivo

curds01 commented 5 years ago

No worries; I'll take care of it myself this weekend.