Skip to content
Snippets Groups Projects
Commit 4e4584bc authored by li213's avatar li213
Browse files

small tweak on the examples

parent 825699a6
No related branches found
No related tags found
1 merge request!21Arch2023 merged
...@@ -7,8 +7,8 @@ class NoisyVehicleSensor(BaseSensor): ...@@ -7,8 +7,8 @@ class NoisyVehicleSensor(BaseSensor):
self.noise_x = noise_x self.noise_x = noise_x
self.noise_y = noise_y self.noise_y = noise_y
def sense(self, scenario, agent, state_dict, track_map): def sense(self, agent, state_dict, track_map):
cont, disc, len_dict = super().sense(scenario, agent, state_dict, track_map) cont, disc, len_dict = super().sense(agent, state_dict, track_map)
tmp = np.array(list(state_dict.values())[0][0]) tmp = np.array(list(state_dict.values())[0][0])
if tmp.ndim<2: if tmp.ndim<2:
return cont, disc, len_dict return cont, disc, len_dict
......
...@@ -433,6 +433,9 @@ class Verifier: ...@@ -433,6 +433,9 @@ class Verifier:
past_runs, past_runs,
params = {}, params = {},
): ):
if (max_height == None):
max_height = float('inf')
root = AnalysisTreeNode( root = AnalysisTreeNode(
trace={}, trace={},
init={}, init={},
......
...@@ -254,9 +254,21 @@ class M5(LaneMap_3d): ...@@ -254,9 +254,21 @@ class M5(LaneMap_3d):
} }
def h(self, lane_idx: str, agent_mode_src: str, agent_mode_dest: str) -> str: def h(self, lane_idx: str, agent_mode_src: str, agent_mode_dest: str) -> str:
if not isinstance(lane_idx,str):
lane_idx = lane_idx.name
if not isinstance(agent_mode_src,str):
agent_mode_src = agent_mode_src.name
if not isinstance(agent_mode_dest,str):
agent_mode_dest = agent_mode_dest.name
return self.h_dict[(lane_idx, agent_mode_src, agent_mode_dest)] return self.h_dict[(lane_idx, agent_mode_src, agent_mode_dest)]
def h_exist(self, lane_idx: str, agent_mode_src: str, agent_mode_dest: str) -> bool: def h_exist(self, lane_idx: str, agent_mode_src: str, agent_mode_dest: str) -> bool:
if not isinstance(lane_idx,str):
lane_idx = lane_idx.name
if not isinstance(agent_mode_src,str):
agent_mode_src = agent_mode_src.name
if not isinstance(agent_mode_dest,str):
agent_mode_dest = agent_mode_dest.name
if (lane_idx, agent_mode_src, agent_mode_dest) in self.h_dict: if (lane_idx, agent_mode_src, agent_mode_dest) in self.h_dict:
return True return True
else: else:
......
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