Newer
Older
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import random
"""
Helper Functions
"""
def create_random_starts_and_goals(env, num_agents):
"""
Given some map file, create a set of starts and goals for the specified
number of agents. This function will create a file folowing the agent file format.
"""
starts = []
goals = []
for i in range(num_agents):
# generate a random start
x = random.uniform(env.boundary[0][0], env.boundary[0][1])
y = random.uniform(env.boundary[1][0], env.boundary[1][1])
x = random.uniform(env.boundary[0][0], env.boundary[0][1])
y = random.uniform(env.boundary[1][0], env.boundary[1][1])
x = random.uniform(env.boundary[0][0], env.boundary[0][1])
y = random.uniform(env.boundary[1][0], env.boundary[1][1])
x = random.uniform(env.boundary[0][0], env.boundary[0][1])
y = random.uniform(env.boundary[1][0], env.boundary[1][1])