Commit 34a3f75b authored by Erik Nygren's avatar Erik Nygren
Browse files

simple implementation of broader conflict detection window

parent 1a91a738
......@@ -178,6 +178,7 @@ class TreeObsForRailEnv(ObservationBuilder):
self.predicted_pos = {}
self.predicted_dir = {}
self.predictions = self.predictor.get(self.distance_map)
print(self.predictions)
for t in range(len(self.predictions[0])):
pos_list = []
dir_list = []
......@@ -334,6 +335,14 @@ class TreeObsForRailEnv(ObservationBuilder):
if coordinate_to_position(self.env.width, [position]) in np.delete(self.predicted_pos[num_steps],
handle):
potential_conflict = 1
if coordinate_to_position(self.env.width, [position]) in np.delete(
self.predicted_pos[max(0, num_steps - 1)],
handle):
potential_conflict = 1
if coordinate_to_position(self.env.width, [position]) in np.delete(
self.predicted_pos[min(self.max_prediction_depth - 1, num_steps + 1)],
handle):
potential_conflict = 1
if position in self.location_has_target and position != agent.target:
if num_steps < other_target_encountered:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment