Skip to content
Snippets Groups Projects
Commit 64fff052 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

FastTreeObs (fix) -> 0.7998

parent 8c8f6ef8
No related branches found
No related tags found
No related merge requests found
...@@ -203,7 +203,6 @@ class FastTreeObs(ObservationBuilder): ...@@ -203,7 +203,6 @@ class FastTreeObs(ObservationBuilder):
possible_transitions = self.env.rail.get_transitions(*new_position, new_direction) possible_transitions = self.env.rail.get_transitions(*new_position, new_direction)
if agents_on_switch: if agents_on_switch:
f = 0
orientation = new_direction orientation = new_direction
if fast_count_nonzero(possible_transitions) == 1: if fast_count_nonzero(possible_transitions) == 1:
orientation = fast_argmax(possible_transitions) orientation = fast_argmax(possible_transitions)
...@@ -213,17 +212,15 @@ class FastTreeObs(ObservationBuilder): ...@@ -213,17 +212,15 @@ class FastTreeObs(ObservationBuilder):
# --- OPEN RESEARCH QUESTION ---> is this good or shall we use full detailed information as # --- OPEN RESEARCH QUESTION ---> is this good or shall we use full detailed information as
# we did in the TreeObservation (FLATLAND) ? # we did in the TreeObservation (FLATLAND) ?
if possible_transitions[dir_loop] == 1: if possible_transitions[dir_loop] == 1:
f += 1
hoa, hsa, hs, v = self._explore(handle, hoa, hsa, hs, v = self._explore(handle,
get_new_position(new_position, dir_loop), get_new_position(new_position, dir_loop),
dir_loop, dir_loop,
depth + 1) depth + 1)
visited.append(v) visited.append(v)
has_opp_agent += hoa has_opp_agent = max(has_opp_agent, hoa)
has_same_agent += hsa has_same_agent = max(has_same_agent, hsa)
has_switch += hs has_switch = max(has_switch, hs)
f = max(f, 1.0) return has_opp_agent, has_same_agent, has_switch, visited
return has_opp_agent / f, has_same_agent / f, has_switch / f, visited
else: else:
new_direction = fast_argmax(possible_transitions) new_direction = fast_argmax(possible_transitions)
new_position = get_new_position(new_position, new_direction) new_position = get_new_position(new_position, new_direction)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment