-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all navigation module assigns random destination using the same seed #704
Comments
Another issue: @staticmethod
def auto_assign_task(map, current_lane_index, final_road_node=None, random_seed=None):
# TODO we will assign the route in the task manager in the future
start_road_node = current_lane_index[0]
if start_road_node is None:
start_road_node = FirstPGBlock.NODE_1
if final_road_node is None:
current_road_negative = Road(*current_lane_index[:-1]).is_negative_road()
# choose first block when born on negative road
block = map.blocks[0] if current_road_negative else map.blocks[-1]
sockets = block.get_socket_list()
socket = get_np_random(random_seed).choice(sockets)
while True:
if not socket.is_socket_node(start_road_node) or len(sockets) == 1:
break
else:
sockets.remove(socket)
if len(sockets) == 0:
raise ValueError("Can not set a destination!")
# choose negative road end node when current road is negative road
final_road_node = socket.negative_road.end_node if current_road_negative else socket.positive_road.end_node
return final_road_node In the line about, the sockets will only belong to the first block or the last block. It is impossible to pick a socket that is in the same block. |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This makes all traffic vehicles choose the same destination all the time. However, I am not sure if setting random seed from base_vehicle will cause the system loss reproducibility:
(note that there previously the navigation module grabs global random seed to pick up the destination, instead of accepting a int as input.)
The text was updated successfully, but these errors were encountered: