rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Add Fault Injection from Behavior Tree Specification #23

Open rdinizcal opened 3 years ago

rdinizcal commented 3 years ago

Added two forms of fault injection from Behavior Tree Specification:

  1. Probability of inverting the signal returned from the condition testing. How to configure? One can configure the probability by setting a variable error in a node Condition. ex.: condition lc( sim_time (repeat=False, tmin=3, tmax=10), error=0.1) Which means that there is a 10% chance of returning an inverted result for the sim_time condition checking.

  2. Introduced delay on checking the condition. How to configure? One can configure the probability by setting a variable delay (in sec) in a node Condition. ex.: condition c_busy_lane( lane_occupied(), delay=3 ) This simulates that the driver is taking at least 3 seconds to check if the next lane is busy. Obs. the total time to check for a condition is then the delay + the checking algorithm processing time.

rdinizcal commented 3 years ago

@rodrigoqueiroz I didn't see before that there were conflicts between this PR and the master. But since you havent been using the delay and error for fault injection, will you even merge them? (this might introduce conflicts with the fix naming PR, please let me know if I can help later on)