-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Proposal for ConcurentWalking "Rickshaw" sharing between the tasks that have to walk #5367
Comments
Metaphor: Implementation details: Assumming bot.position (0,0) Will check:
|
And (this with all the cost calculations explained above for every tasks...) would be activated easily by decorating the step() in the StepWalker
|
I would want your input:
For the moment i will make two big assumptions:
|
Just sleepy thoughts: why not just implement some sort of priority queue with some kind of limit over Walker; on step() method we will extract and calculate less cost position and move to that coords, etc? |
@sohje I am afraid that might not fix everything...
And anyway there is not much difference between your suggestion and what i had in mind..(functionally). I just believe the decorator approach would prevent us from adding this TrafficControlor logic to the StepWalker class and thus keep that class readability, plus that storing those object in a different class the StepWalker will also solve some persistency. Second part is that pure StepWalker objects are differentiated from the StepWalker object leaving inside a different Class (taskBase type). Thus we'd still be able to test StepWalker logic in unit test without looking at the queue part with is not needed for the pure StepWalker class. (and we'll create separate test for the TrafficController) |
I've been thinking about if our destination picking tasks (movetofort, catchpokemon, etc) help build a list of possible destinations (from all read cells). We then run an algorithm where we map out our next and future destinations - updating our path as we pick up new stops, new pokemon, etc. Maybe use a+ plus some priority bits based on config settings (rarer pokemon, etc), estimated exp gain by heading towards a larger group of lured stops, etc. Then our fort spinner and pokemon catching tasks don't call our stepper - instead they only do those things and our walker task is the only thing directly using stepwalker. As an added bit, we could have our map show your planned route. To go a step further, we could use our starting position and a new config setting for max distance from the starting position - anything, except for VIP pokemon, outside of that range is ignored. That would solve a very old FR. I know this isn't quite what you're looking for as far as input, but I hope it can be helpful! |
@mjmadsen yes i think i can solve all this with my above proposal... |
I don't have a fixation on decorator approach [some may be scared only when they read this word] but i see advantage:
|
If i understand you correctly, we can make a singlton class and every task will get the same object and operate on it. |
@sohje every task will get "an" object, the coordinated by logic one... in order to precompute paths and so on... it cannot be the same one [new object could also be created if needed based on ALL the Tasks destinations combined and could be called from here.] (The uglyness was only for code exemplification... to show that it become a static method)
|
To simplify a bit currently: Phase 0: # current implementation
Phase 1: Could be skipped if we agree to go for phase 2 directly
Phase 2:
|
I don't understand this "conflict" issue. There is bug in MoveToFort line 112, it is returning SUCCESS instead of RUNNING. You change that single line and all the issues you mention above are gone.
|
@anakin5 I suggest please take the time and read completely this proposal, The examples I gave as issues were mere examples don't focus on those per say (are the first verified identified issues that pop to mind)
Your comments are valid in .tick() context not at a higher level (end result achieved)
As long as people write new Tasks new such issues will arise... This proposal focuses also on future.. Is not limited at the currently identified issues.... I was mentioning in Assumptions:
I am proposing a sort of TrafficController to "rule them all" (in the decorator form - but hey forget implementation details for now!) and to do future destinations path routing... ...and you are saying that the exampled i gave are fixed... Are you saying we don't need such a Traffic Controller? |
Yes, maybe we just make sure 2 tasks cannot drive the position in same time. I proposed something simple as a comment in my PR: in MoveToFort
in FollowPath
You can do that with decorator as well, but that is an implementation detail |
@anakin5 what about conflicting destination how do you solve that? because you just locked the first one you received! What about calculating best route? |
There is only one task giving destination, all others are silent. Priority is handled with order in the task list, just like for other tasks. |
I think you ignore this part
@anakin5 we collaborated in few PRs and issues before and I believe we're both quick to contradict each other at times... [but thats's usually because we provide close to real-time feedbacks to each other] Please take the time to also check if there is a positive value in this proposal not only contradict. So far it looks to me that your focus was only on the identifies issues examples. |
I will say I think you guys work well together after you both get on the same page. The walker updates you guys put in are great. Keep up the great work! We should try to use our chat more often (including private chats) so establish our thoughts. We all have the same goal of making an awesome bot. You're both very good programmers and have a great deal of insight. 👍 |
I have to mention that I like that @anakin5 is usually able to come up with a simpler solution... But i still see dead peoples here:
One high level result I would expect as a user is to go from A..B...C...Z (from my path file) but also pick all the pokestops in the way... in both cases. |
I guess people use FollowPath because they want the bot to stick to a route. FollowPath is also spinning Forts, so there is no need to especially move to a fort. Let's say you still want to mix them to achieve something. There is a of issues in front. We are only moving to spin fort and hatch eggs. It does not matter much whether you were able to find the shortest way to spin the 250 forts of your area. I am just feeling this is going to take a very long time to get something working. And then another very long time to fix bugs. And then everything is going to be more complicated to implement. But I mean, you asked for thoughts :), I am OK if you do something and it works as well. I just don't feel that work is going to be used much. |
@anakin5 Thanks! feedback appreciated... this one i found to be more constructive. one of the side advantage to my proposal would be that we could possibly show the computed path in the web GUI, that would be a candy future to have... |
I plan to do some changes but not push yet to upstream branches yet that would modify the Polyline object to support base line segments operations... #5374 #5379 to minimise the nr. of API calls and to use Polyline.get_total_distance() for distance calculations.
|
lets just also add that i would consume less API calls if i know more destinations in advance... Thus much of the computation would be done indirectly on the Google side. |
Below proposal is related to all tasks that are changing bot.position [via StepWalker]
Currently we achieve already a great deal (almost everywhere) to standardise the bot.position changes to only use the StepWalker.step() [be it the PolylineWalker(StepWalker)]
Assumptions:
Identified Issues:
Reason for the proposal against a refactoring alternative:
The text was updated successfully, but these errors were encountered: