Esempio n. 1
0
    def compute_c_polygon(self, agent):
        agent_points = copy_points_list(agent.get_points())

        all_points = []
        for point in self.get_points():
            for agent_point in agent_points:
                all_points.append(point - agent_point)

        c_polygon_points = generate_convex_hull(all_points)
        return Polygon(c_polygon_points)
Esempio n. 2
0
    def compute_c_polygon(self, agent):
        agent_points = copy_points_list(agent.get_points())

        all_points = []
        for point in self.get_points():
            for agent_point in agent_points:
                all_points.append(point - agent_point)

        c_polygon_points = generate_convex_hull(all_points)
        return Polygon(c_polygon_points)
Esempio n. 3
0
    def add_points(self, points):
        self.points.extend(copy_points_list(points))

        if len(self.points) != len(set(self.points)):
            raise Exception('Points in Polygon must be distinct')
Esempio n. 4
0
 def get_points(self):
     return copy_points_list(self.points)