Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] Improvment in the Task manager using threading libary #2034

Closed
martynvandijke opened this issue Jul 31, 2016 · 3 comments
Closed

[dev] Improvment in the Task manager using threading libary #2034

martynvandijke opened this issue Jul 31, 2016 · 3 comments

Comments

@martynvandijke
Copy link

According to the documentation from the tasks https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Configuration-files is it not far better and more efficient to thread this using the threading library.

My proposal is to thread the walk to the fort and by using the radius of catching Pokemon and the given speed the thread timer can be calculated.

Will work on a pull request but i do not have much time this weekend, please let me know how else this can be improved.

@elicwhite
Copy link
Contributor

I believe we actually don't want this to be multi threaded. Each task has the ability to short circuit the tasks after it. For example, we want to let people configure the bot to catch all the pokemon around them before moving to the next fort. Otherwise we end up walking away from pokemon in order to go walk around the map.

The approach we are taking is that of a behavior tree. One of the other thins that will let us support are more complicated tasks that have sub tasks which run following a similar approach. Take a look at this for more context: #142

Also, we are rate limited by the api and thus only make 2 requests per second. We actually wouldn't be that much better off parallelizing these tasks. Currently we are limited by the api, not cpu time.

@martynvandijke
Copy link
Author

Sounds like reasonable (and stupid of me) maybe post this in the wiki ?

@elicwhite
Copy link
Contributor

hoanghuynh pushed a commit to hoanghuynh/PokemonGo-Bot that referenced this issue Sep 28, 2016
hoanghuynh pushed a commit to hoanghuynh/PokemonGo-Bot that referenced this issue Sep 28, 2016
* show pokemon icon in select2 elements

* vertical-align class

* Add support for arbitrary pokemon sprites (PokemonGoF#1886)

* Add support for arbitrary pokemon sprites

* Use var instead of let

* Fix indentation

* Update select box listener for newer code

* Auto-resize icons depending on zoom depth

* Fix indentation

* Make icon cropping less aggressive, as it's only due to rounding errors

* Merged in changes from master README

* use sprite with css classes (not tested yet)

* better like this.

* resize + vertical align

* Add geolocation capability to mobile route (PokemonGoF#1687)

* Allow client to specify location of origin

* Conditionally get device's location for mobile route

* Reset app.min.js as it didn't change

* Add dynamic countdown timer and names

* Fix lured Pokéstops (PokemonGoF#1943)

* Update README.md

* easy-setup.sh: updates and cleanup (PokemonGoF#1836)

* easy-setup.sh: updates and cleanup

  - Check for debain based OS otherwise quit.
  - Use already bundled get-pip.py over debian's.
  - Use sudo in commands instead of exiting.
  - Be a little smarter with the creation of credentials.
  - Be more verbose for the user.
  - Declare script as shell script
  - Give script executable permissions.

* easy-setup.sh: remove sudo from pip

* fixed retrieving and storing values in localStorage (PokemonGoF#1694)

* Changed gym icons into shields/badges (PokemonGoF#1946)

* Changed gym icons into shields/badges

* Added Harmony as gym shield/badge

* Revert "Fix lured Pokéstops" (PokemonGoF#2033)

* Loading pokemons hangs, when Notification is not supported in browser (PokemonGoF#1985)

* Add Id to dropdown. (PokemonGoF#1958)

* Fix pokemon filter dropdown (PokemonGoF#2042)

* value was removed in AHAAAAAAA/PokemonGo-Map@b4c36a5

* Skip notification when merely redrawing existing pokemon (PokemonGoF#2017)

* Fix order of loading map.js and the map api (PokemonGoF#2043)

* Let's load map.js first. The callback for the api requires initMap
  to be defined or things break.
* Furthermore, defer, but don't async, the api call so we're sure
  everything is ready to go before it fires.

* Doesn't hammer the server when map download fails. (PokemonGoF#2040)

* Higher navbar (PokemonGoF#1515) (PokemonGoF#2050)

* Update main.css

* Update app.min.css

* Update _nav.scss


Rebase of PokemonGoF#1515

* Fix up this configuration mess (PokemonGoF#2021)

* Kill credentials.json with fire
* Match up our command line options with config.ini options
* Switch to ConfigArgParser to make the task of overriding
  config.ini options via command line parameters easier
* This provides a much easier long-term method of maintaining
  config/argument options

* Travis tests (PokemonGoF#2056)

* Travis tests

* Amended script tests per Chlodochar's suggestion

* Remove lured pokemon toggle (PokemonGoF#1995)

Remove lured pokemon toggle, fix pokestop with no lured pokemon

* Fix missing bracket

* Revert "Higher navbar (PokemonGoF#1515) (PokemonGoF#2050)" (PokemonGoF#2082)

There were problems with scrolling in the sidebar

* removed app.min.js and app.min.css as they are gitignored (PokemonGoF#2034)

* Fixes BOM marker with setup.bat on Windows (PokemonGoF#2108)

Currently, the Out-File PowerShell Cmdlet breaks config.ini by turning it into a Little Endian UTF-16 file, in turn breaking the script.
Replaced the Out-File Cmdlet with a python in-line replace of a file (I mean, we already have python, so why not make full use of it...?)

* Revert "removed app.min.js and app.min.css as they are gitignored" (PokemonGoF#2114)

* Update config.ini.example (PokemonGoF#2149)

Spelling error correction.

* outsource sprite css

* show pokemon icon in select2 elements

* vertical-align class

* use sprite with css classes (not tested yet)

* better like this.

* resize + vertical align

* outsource sprite css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants