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

agent and target placement

parent 465f1e9f
No related branches found
No related tags found
No related merge requests found
...@@ -687,13 +687,6 @@ def realistic_rail_generator(nr_start_goal=1, seed=0): ...@@ -687,13 +687,6 @@ def realistic_rail_generator(nr_start_goal=1, seed=0):
goal_track = (off_set, width - 1) goal_track = (off_set, width - 1)
new_path = connect_rail(rail_trans, rail_array, start_track, goal_track) new_path = connect_rail(rail_trans, rail_array, start_track, goal_track)
add_pos = (int((start_track[0] + goal_track[0]) / 2), int((start_track[1] + goal_track[1]) / 2))
agents_positions.append(add_pos)
agents_directions.append(np.random.choice([3, 1]))
add_pos = (int((start_track[0] + goal_track[0]) / 2), int((2 * start_track[1] + goal_track[1]) / 3))
agents_targets.append(add_pos)
# track one (full track : left right) # track one (full track : left right)
if off_set_loop > 0: if off_set_loop > 0:
if off_set_loop % 2 == 1: if off_set_loop % 2 == 1:
...@@ -758,12 +751,11 @@ def realistic_rail_generator(nr_start_goal=1, seed=0): ...@@ -758,12 +751,11 @@ def realistic_rail_generator(nr_start_goal=1, seed=0):
c = (off_set + nbr_track_loop, x[2 * x_loop + 1] + 1) c = (off_set + nbr_track_loop, x[2 * x_loop + 1] + 1)
make_switch_w_e(width, height, grid_map, c) make_switch_w_e(width, height, grid_map, c)
if nbr_track_loop > 0: add_pos = (int((start[0] + goal[0]) / 2), int((start[1] + goal[1]) / 2))
add_pos = (int((start[0] + goal[0]) / 2), int((start[1] + goal[1]) / 2)) agents_positions.append(add_pos)
agents_positions.append(add_pos) agents_directions.append(np.random.choice([3, 1]))
agents_directions.append(np.random.choice([3, 1])) add_pos = (int((start[0] + goal[0]) / 2), int((2*start[1] + goal[1]) / 3))
add_pos = (int((start[0] + goal[0]) / 2), int((2*start[1] + goal[1]) / 3)) agents_targets.append(add_pos)
agents_targets.append(add_pos)
agents_position = [] agents_position = []
agents_target = [] agents_target = []
......
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