Randomized Walkspeed#3997
Conversation
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)
|
@breezelo, thanks for your PR! By analyzing the annotation information on this pull request, we identified @TheSavior, @douglascamata and @Quantra to be potential reviewers |
|
#3943 is similar. I would appreciate input. |
|
@jimmywarting the initial code used a fraction to alter set walking speed. Per a request, I switched to a max and min setup. |
|
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 |
|
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. |
|
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.
|
imported the random module since importing just the function wasn't enough (for uniform) |
| from cell_workers.utils import distance | ||
| from human_behaviour import random_lat_long_delta, sleep | ||
|
|
||
| import random |
There was a problem hiding this comment.
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()
|
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
|
Randomizes walk speed between 1% and config.walk_offset_percent_max if config.walk_random = true