Git Product home page Git Product logo

ingress-fieldplan's People

Contributors

dekan avatar erichschroeter avatar jpeterbaker avatar mricon avatar tvwenger avatar veep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ingress-fieldplan's Issues

Support ortools 7

Google's ortools-7 is not backwards compatible, so fix the code to support the newer release.

Attribute: 'NoneType' object has no attribute "Copy"

I'm getting an error and can't figure out what the issue is.

Traceback (most recent call last): Traceback (most recent call last): File "C:\Users\sool1\Anaconda3\lib\multiprocessing\process.py", line 258, in _bootstrap self.run() File "C:\Users\sool1\Anaconda3\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "C:\Users\sool1\Downloads\ingress-fieldplan-master\ingress-fieldplan-master\fieldplan.py", line 49, in queue_job b = mygraph.copy() Traceback (most recent call last): File "C:\Users\sool1\Anaconda3\lib\multiprocessing\process.py", line 258, in _bootstrap self.run() AttributeError: 'NoneType' object has no attribute 'copy'

Feature request: Starting point

Sometimes the starting portal in the generated plan is a portal furthest away from my current position. In these cases it is hard to find a alternative plan, because Fieldplan automatically uses the best one. I would like to suggest a starting point (and a end point).

This is how it could work:

For each generated plan, calculate the distance between the first portal in the plan and the start point and add this distance to the total distance. Keep plan if total distance is shorter than previous best found distance.

Also, an optional end point could work in a similar way: For each generated plan, calculate the distance between the last portal in the plan and the end point and add this distance to the total distance. Keep plan if total distance is shorter than previous best found distance.

Formula parse error in Google Spreadsheet

There is a locale issue with Google Spreadsheet. Some locales use a comma as argument separators, others (e.g. some European countries) use semi-colons (;). Ingress Fieldplan use comma and because of this the HYPERLINK function does not work in my country.

Google Spreadsheet say "Formula parse error".

In other words HYPERLINK("http....","2 km") needs to be changed to HYPERLINK("http....";"2 km").

Could the separator be a option?

Question: scenario - all portals are already captured

In my scenario all portals are usually my color already - and I have keys for them. Is there an even more optimal route in this scenario? Just curious. Maby there could be a optional column to specify the current colour of each portal?

Generating IITC Draw Toos json

A feature request: If not too much work, it would be helpful if the finished generated plan could be exported as json to use with IITC Draw Tools. I'm not sure of the format used in Draw Tools, but it seems pretty simple.

Potential dependency conflicts between ingress-fieldplan and httplib2

Hi, ** ingress-fieldplan ** directly and transitively introduced multiple versions of httplib2.

As shown in the following full dependency graph of ingress-fieldplan, ingress-fieldplan requires httplib2 (the latest version), while the installed version of google-api-python-client( 1.7.10) requires httplib2>=0.9.2, <1dev.

According to Pip's “first found wins” installation strategy, httplib2 0.13.1 is the actually installed version.

Although the first found package version httplib2 0.13.1 just satisfies the later dependency constraint (httplib2>=0.9.2,<1dev), it will lead to a build failure once developers release a newer version of httplib2.

Dependency tree--------

ingress-fieldplan-master
| +-google-api-python-client(version range:*)
| | +-httplib2(version range:>=0.9.2,<1dev)
| | +-google-auth(version range:>=1.4.1)
| | +-google-auth-httplib2(version range:>=0.0.3)
| | +-six(version range:>=1.6.1,<2dev)
| | +-uritemplate(version range:>=3.0.0,<4dev)
| +-googlemaps(version range:*)
| +-httplib2(version range:*)
| +-matplotlib(version range:*)
| +-networkx(version range:*)
| +-numpy(version range:*)
| +-oauth2client(version range:*)
| | +-httplib2(version range:>=0.9.1)
| | +-pyasn1(version range:>=0.1.7)
| | +-pyasn1-modules(version range:>=0.0.5)
| | | +-pyasn1(version range:>=0.4.6,<0.5.0)
| | +-rsa(version range:>=3.1.4)
| | +-six(version range:>=1.6.1)
| +-ortools(version range:<8.0,>=7.0)

Thanks for your attention.
Best,
Neolith

Maxfield v4.0

I've just updated Maxfield to version 4.0, which is a nearly complete re-write of the original code. It's way more efficient and optimized now, and the code is cleaner.

If you're interested in updating this, it would solve some of the other issues (DiGraph one, specifically). Alternatively, if you want to implement your google drive stuff in the v4.0 framework, I'd accept the pull request and add the feature to the website!

Add support for SBULs

Sometimes I got plans with "8 out, 13 in" links for portal A and "1-2 in" for portals linked with it. But if I use one SBUL on portal A, I can reverse links and minimize the time for hacking it.

Can you add support for installing 1 (16 out) or 2 (24 out) SBULs?

Unable to fulfill requirements ortools < 7.0

I'm trying to install ingress fieldplan on a macbook pro (2009) with osx el capitan 10.11.6.

It seems latest ortools is 7.1. Fieldplan requirements is "< 7.0"

I get the following error when trying to install:

$ pip3 install -r requirements.txt
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (3.1.0)
Requirement already satisfied: networkx in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (2.3)
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (1.16.4)
Requirement already satisfied: google-api-python-client in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (1.7.9)
Requirement already satisfied: oauth2client in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (4.1.3)
Requirement already satisfied: httplib2 in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (0.13.0)
**Collecting ortools<7.0 (from -r requirements.txt (line 7))
ERROR: Could not find a version that satisfies the requirement ortools<7.0 (from -r requirements.txt (line 7)) (from versions: 7.0.6546, 7.1.6720, 7.2.6977)
ERROR: No matching distribution found for ortools<7.0 (from -r requirements.txt (line 7))**`

Not sure how to proceed. I've tried editing requirements.txt and remove the version check, but it seems that does not help. When running fieldplan.py I get error.

$ ./fieldplan.py -m bicycling -s https://docs.google.com/spreadsheets/d/1FPMcKGvJATRDTVnJLHtXaOSZo4WST9GssxxxxxxLs/edit?usp=sharing
Grabbing the spreadsheet
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Considering 11 portals
Generating the distance matrix
Finding the shortest plan
Started 2 worker processes
Ctrl-C to exit and use the latest best plan
Process Process-1:
Process Process-2:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "./fieldplan.py", line 57, in queue_job
workplan = maxfield.makeWorkPlan(linkplan, b, ab, args.roundtrip, args.beginfirst)
File "/Users/daniel/ingress-fieldplan-master/lib/maxfield.py", line 221, in makeWorkPlan
routing = pywrapcp.RoutingModel(len(all_p), 1, [endp], [startp])
File "/Users/daniel/Library/Python/3.7/lib/python/site-  packages/ortools/constraint_solver/pywrapcp.py", line 3197, in __init__
this = _pywrapcp.new_RoutingModel(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RoutingModel'.
Possible C/C++ prototypes are:
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &)
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &,operations_research::RoutingModelParameters const &)

Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "./fieldplan.py", line 57, in queue_job
workplan = maxfield.makeWorkPlan(linkplan, b, ab, args.roundtrip, args.beginfirst)
File "/Users/daniel/ingress-fieldplan-master/lib/maxfield.py", line 221, in makeWorkPlan
routing = pywrapcp.RoutingModel(len(all_p), 1, [endp], [startp])
File "/Users/daniel/Library/Python/3.7/lib/python/site-packages/ortools/constraint_solver/pywrapcp.py", line 3197, in __init__
this = _pywrapcp.new_RoutingModel(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RoutingModel'.
Possible C/C++ prototypes are:
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &)
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &,operations_research::RoutingModelParameters const &)`

Could this be related to that I'm using ortools 7.1?

Feature request: Make time less prominent

Ingress Fieldplan sorts by max area/min or by max AP/min. However, in my scenario time is not that important - because I get the keys to a distance portal from another agent. I can therefore link to that portal without traveling at all. In my scenario I'm trying to create a BAF using -u and -c idkfa flags, however the plan I'm getting is not the best MU - because the program assumes I will travel to all portals.

Would it be possible to order by max area (or MU) first and time as a second factor?

Problem with cached data?

I’m using version 3.2.0.

When running:

$ ./fieldplan.py -c idkfa -m bicycling -s https://docs.google.com/spreadsheets/d/1LNwNO7KuXxkvkyfCmfYuz4OZ0c9voP0O4oV7N7nyPMc/edit?usp=sharing

I get the result:

Ctrl-C to exit and use the latest best plan
(      2.69 km, 0.11 km2, 12 portals, 55575 AP, 0:30:15): 1/10000     
(      2.48 km, 0.13 km2, 12 portals, 55575 AP, 0:28:15): 1/10000     
(      2.20 km, 0.10 km2, 12 portals, 57138 AP, 0:27:30): 33/10000     
(      1.61 km, 0.12 km2, 12 portals, 55575 AP, 0:25:15): 177/10000     
(      2.03 km, 0.12 km2, 12 portals, 56825 AP, 0:25:15): 24/10000     
(Best: 1.64 km, 0.14 km2, 12 portals, 57138 AP, 0:24:30): 10000/10000     
Saved plan cache in /Users/daniel/.cache/ingress-fieldmap/plans/bicycling-eeec006ade36f97de13326a31d6f807bb1aab15e
.
.
Total workplan distance: 1.64 km
Total workplan play time: 0:24:30 (0:00:00 bicycling)
Total AP: 57138 (33138 without capturing)
Adding "🚲 0:24:30 (1.64km/12P/57,138AP)" sheet with 29 actions
Resizing columns and adding colours
Spreadsheet generation done

Q1: What do ”0:00:00 bicycling” mean?

If i rerun with the exact command I get the result:

Loading cache data from cache /Users/daniel/.cache/ingress-fieldmap/plans/bicycling-eeec006ade36f97de13326a31d6f807bb1aab15e
Best distance of the plan loaded from cache: 1.64 km
Best coverage of the plan loaded from cache: 0.14 km2
Best AP of the plan loaded from cache: 57138
Finding an efficient plan that maximizes AP
Started 2 worker processes
Ctrl-C to exit and use the latest best plan
(      1.64 km, 0.14 km2, 12 portals, 57138 AP, 0:44:00): 1/10000     
(      2.54 km, 0.12 km2, 12 portals, 55262 AP, 0:30:00): 9/10000     
(      2.28 km, 0.11 km2, 12 portals, 57138 AP, 0:29:30): 1/10000     
(      2.46 km, 0.12 km2, 12 portals, 56512 AP, 0:29:00): 1/10000     
(      2.15 km, 0.11 km2, 12 portals, 56512 AP, 0:27:00): 7/10000     
(      2.40 km, 0.14 km2, 12 portals, 57138 AP, 0:26:30): 89/10000     
(      2.22 km, 0.15 km2, 12 portals, 56825 AP, 0:26:15): 211/10000     
(      1.82 km, 0.11 km2, 12 portals, 56512 AP, 0:26:00): 32/10000     
(      1.95 km, 0.11 km2, 12 portals, 55262 AP, 0:25:00): 147/10000     
(      1.96 km, 0.10 km2, 12 portals, 56825 AP, 0:25:15): 286/10000     
(Best: 1.32 km, 0.12 km2, 12 portals, 57138 AP, 0:24:30): 10000/10000     

Q2: Why does it start using a plan of 44:00 minutes when the already cached best plan already should be 24:30 minutes? Something wrong with the cached data?

Sorry if I’m missing something obvious.

Feature Request: round trip

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.

Request : Order by best total AP

Currently the application order by best AP/minute. However, if portals are close, then time wont matter as much. Would it be possible to make an option to order by AP first and time secondly?

Code breaks when new solution has same name as previous one

I encountered an issue while using the Ingress Field Planner tool where the code breaks if a new solution has the same name as a previous one. This happens when the code tries to create a new sheet in Google Sheets with the same name as an existing one, which is not allowed.

Steps to reproduce:

  1. Run the code and get some results.
  2. Stop the code before it finishes all iterations.
  3. Run the code again.
  4. If the new solution has the same name as the previous one, the code will break with the following error message:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/[SPREADSHEET_ID]:batchUpdate?alt=json returned "Invalid requests[0].addSheet: A sheet with the name "[SHEET_NAME]" already exists. Please enter another name.". Details: "Invalid requests[0].addSheet: A sheet with the name "[SHEET_NAME]" already exists. Please enter another name.">

Expected behavior:

The code should either overwrite the existing sheet with the new solution or append a unique identifier to the sheet name to avoid naming conflicts.

Suggested fix:

Before creating a new sheet, the code should check if a sheet with the same name already exists. If it does, the code could either:

  • Overwrite the existing sheet with the new solution, or
  • Append a unique identifier (such as a timestamp or random number) to the sheet name to avoid naming conflicts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.