Skip to content

Comments

Randomized Walkspeed#3997

Closed
BreezeRo wants to merge 23 commits intoPokemonGoF:devfrom
BreezeRo:patch-2
Closed

Randomized Walkspeed#3997
BreezeRo wants to merge 23 commits intoPokemonGoF:devfrom
BreezeRo:patch-2

Conversation

@BreezeRo
Copy link
Contributor

Randomizes walk speed between 1% and config.walk_offset_percent_max if config.walk_random = true

Randomize user walk speed between 1% and user defined walk_offset_percent_max if walk_random = true
support walk_offset_percent_max (randomize walkspeed variable)
@mention-bot
Copy link

@breezelo, thanks for your PR! By analyzing the annotation information on this pull request, we identified @TheSavior, @douglascamata and @Quantra to be potential reviewers

@mjmadsen
Copy link
Contributor

#3943 is similar. I would appreciate input.

@mjmadsen
Copy link
Contributor

@jimmywarting the initial code used a fraction to alter set walking speed. Per a request, I switched to a max and min setup.

@BreezeRo
Copy link
Contributor Author

Matter of preference I suppose, figured this was the shortest and cleanest way to do it, it would work in either case though the min/max step walk values in #3943 are good as well. In this case 1% is the minimum

@mjmadsen
Copy link
Contributor

You could remove the bool and just have folks set percentage to 0 if they do not want variance - but you'd need to make the minimum variance percentage 0.

@BreezeRo
Copy link
Contributor Author

I set the minimum to 1% since we are using a switch in the config for true/false ("walk_random", true), if set to false it's back to default (0)

 from random import random
imported whole module due to inconsistencies.
@BreezeRo
Copy link
Contributor Author

imported the random module since importing just the function wasn't enough (for uniform)

@elicwhite
Copy link
Contributor

This might not be necessary now that #3943 has been merged. I'll let you guys decide and @breezelo, please close this PR if not necessary anymore.

from cell_workers.utils import distance
from human_behaviour import random_lat_long_delta, sleep

import random
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the flat import random because it makes using the functions like random.uniform() or random.choice() more obvious what they are. Other files in this project do from random import uniform then uniform()

@BreezeRo
Copy link
Contributor Author

Just saw @TheSavior, will close in about ~4 hours, just want to see if anyone else has any input on this one - I'm satisfied with #3943

@Quantra
Copy link
Contributor

Quantra commented Aug 15, 2016

@breezelo There's more than one way to solve most problems =]

in #3943
walk_min = 2
walk_max = 4

is the same as in here
walk = 200
walk_offset_percent_max = 0.02

Live dangerously I want to set my walk to 200 =P

@BreezeRo
Copy link
Contributor Author

BreezeRo commented Aug 15, 2016

@Quantra
That's because there is a mistake here, should of been

self.speed = speed + speed * random.uniform(0.01, self.bot.config.walk_offset_percent_max) ;) updated

@k4n30 k4n30 closed this Aug 17, 2016
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

Successfully merging this pull request may close these issues.

6 participants