mricon / ingress-fieldplan

Generate an easy workplan for Ingress fielding excursions
GNU General Public License v3.0
31 stars 8 forks source link

Feature Request: round trip #3

Closed veep closed 5 years ago

veep commented 5 years ago

I love the app already, the only real problem I've run into is plans that start me or leave me out in the middle of nowhere.

I would love a flag that simply started and ended the generated plan at the first portal, taking that into account in the calculated distance.

I implemented a version of this very naively, where the flag means that (0, None, 0) is added at the beginning and end of each generated plan.

I can provide a pull request with that code which seems to work, though I lack understanding to be sure it's doing exactly the right thing.

mricon commented 5 years ago

Yeah, I'll try to work that in -- it's pretty easy. In https://github.com/mricon/ingress-fieldplan/blob/b3d26ee932ab178b227eba1f620552cd0173f81a/lib/maxfield.py#L177, we can start the capture plan with the last portal in the field plan, instead of starting with the portal furthest away.

mricon commented 5 years ago

(That said, if you select the portals inside a triangle like I provide in the examples, this almost always results in round trip plans.)

mricon commented 5 years ago

I've added the roundtrip option in fd5560dfae86a73f8d5c659d53558dab964bbd17. Let me know if it does the right thing for you reliably -- there may be situations where the last portal is optimized away after we've already put together a workplan.