in gym-compete/gym_compete/new_envs/sumo.py [0:0]
def _reset_agents(self):
# set agent 0
min_gap = 0.3 + self.MIN_RADIUS / 2
for i in range(self.n_agents):
if i % 2 == 0:
x = np.random.uniform(-self.RADIUS + min_gap, -0.3)
y_lim = np.sqrt(self.RADIUS**2 - x**2)
y = np.random.uniform(-y_lim + min_gap, y_lim - min_gap)
else:
x = np.random.uniform(0.3, self.RADIUS - min_gap)
y_lim = np.sqrt(self.RADIUS**2 - x**2)
y = np.random.uniform(-y_lim + min_gap, y_lim - min_gap)
self.agents[i].set_xyz((x,y,None))