Update IDM script

This commit is contained in:
Johannes Fischer
2022-02-23 18:16:01 +01:00
parent 9c3cb4fb55
commit a3280893af
2 changed files with 25 additions and 39 deletions

View File

@@ -204,6 +204,7 @@ class IDMRulePolicy(BaseAlgorithm):
else:
d = np.Inf
d_des = self.d_min
self._env._env._graph._neighbor_dict={}
assert (d_des>= self.d_min)
action = self.a_max*(1 - (v_ego/self.v_max)**4 - (d_des/d)**2)