JonasStjerne / resilient-pathfinding

https://p7-xi.vercel.app
0 stars 0 forks source link

Simulation stats disturbances touch #110

Open JonasStjerne opened 7 months ago

JonasStjerne commented 7 months ago

Improve the result returned by simulateRoute for the disttouched to only count the disturbances that were "rolled a dice on".

Right now every disturbance in the node is counted if the path goes through it. Let's say we are at a node that has four outgoing disturbances. Right now every 4 nodes will be added to the disttouched even if the first disturbance triggers the push of the robot and the other three disturbances did not get rolled for.

Improve the simulate route to only count the disturbances that had a change of triggering. If the second disturbance triggers. two should be added to the dist touched.

Also make it random which disturbance is picked and not just iterate over array.