Skip to content

nmp lists #148

Closed
Closed

Description

@yakra
if len(nmps) > 0:
    if w.near_miss_points is None:
        w.near_miss_points = nmps
    else:
        w.near_miss_points.extend(nmps)

    for other_w in nmps:
        if other_w.near_miss_points is None:
            other_w.near_miss_points = [ w ]
        else:
            other_w.near_miss_points.append(w)

Why:

  • init Waypoint.near_miss_points to None,
  • set nmps = all_waypoints.near_miss_waypoints(w, 0.0005),
  • check nmps length,
  • check whether w.near_miss_points is None (it will be, since this is a brand new waypoint not yet added to the QuadTree),
  • set w.near_miss_points = nmps, and
  • check whether other_w.near_miss_points is None & do stuff...

When we can:

  • init Waypoint.near_miss_points to [],
  • dispense with the nmps list altogether,
  • just set w.near_miss_points = all_waypoints.near_miss_waypoints(w, 0.0005), and
  • simply append w to other_w's list?

Activity

  1. self-assigned this
    on Dec 6, 2018
  2. yakra commented on Dec 6, 2018

    @yakra
    ContributorAuthor

    It looks like there is a reason. I've not yet figured out what it is.

  3. jteresco commented on Dec 9, 2018

    @jteresco
    Contributor

    A quick look at this and I'm thinking it's because A might be a NMP of B and B an NMP of C but A is not an NMP of C? Though maybe they should all be clustered together in such a case.

  4. yakra commented on Dec 9, 2018

    @yakra
    ContributorAuthor

    B would be our w, and A & C members of other_w.
    Thus B gets appended to A's list & C's list, with A & C assigned to B's list via all_waypoints.near_miss_waypoints(B, 0.0005).
    When A & C are w (when that point is read in from its WPT file), they won't be detected as NMPs of one another, and life goes on.

    It looks like there is a reason. I've not yet figured out what it is.

    I was misled by some unrelated bugs in some other code I was working on, and thought there may be some more substance to this. I've now reconsidered my reconsideration. :)

    I think this should work.

    I may give it a try in the future, but if the changes described in #141 result in a speed increase, that would make this issue moot.

  5. yakra commented on Dec 13, 2018

    @yakra
    ContributorAuthor

    #141 can't happen, due to the way nmp_merged files are made.
    I'll look into this at some point.

  6. yakra commented on Jan 4, 2019

    @yakra
    ContributorAuthor

    I ended up doing this in siteupdate.cpp, and it's been working well for a couple weeks now.
    No DIFFs in nearmisspoints.log, tm-master.nmp, or nmp_merged/.
    Implemented the same in siteupdate.py; also no DIFFs.
    No discernable difference in processing time. Running some more tests to see what I can see, cuz I'm a nerd. :D

  7. yakra commented on Jan 9, 2019

    @yakra
    ContributorAuthor

    Reading WPTs is a fraction of a second slower, though this may just be within the margin of error.
    Writing nmp_merged files: there's enough variation here that I can't see any clear effect.
    Writing nearmisspoints.log and tm-master.nmp, however, is pretty clearly increasing from 0.7s to 0.9s.

    Not implementing this.

  8. yakra commented on May 20, 2020

    @yakra
    ContributorAuthor

    I'm going to give this another look.

  9. reopened this on May 20, 2020
  10. added a commit that references this issue on Jan 9, 2021
  11. added a commit that references this issue on Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions