Пример #1
0
 def add_forced(self, forced_vertices):
     """
     Add forced vertices - must be selected
     """
     for u in forced_vertices:
         self.__check_id(u)
         G.set_vertex_property(self, "forced", u, True)
Пример #2
0
 def add_solved(self, solved_vertices):
     """
     Add solved vertices - constraints operating only on solved 
     vertices are dropped to avoid impossible situations
     """
     for u in solved_vertices:
         self.__check_id(int(u))
         G.set_vertex_property(self, "solved", u, True)
Пример #3
0
    def set_partner(self, u, value, vals=None):
        assert (type(value) == int)
        assert (value < G.get_number_of_vertices(self))

        if vals is None:
            G.set_vertex_property(self, "partner", u, value)
        else:
            G.set_vertex_property(self, "partner", 0, 0, vals=vals)
Пример #4
0
 def set_cost(self, u, value):
     G.set_vertex_property(self, "costs", u, value)
Пример #5
0
    def set_position(self, u, value):
        assert (type(value) == np.ndarray)
        assert (len(value) == 3)
        assert (value.ndim == 1)

        G.set_vertex_property(self, "position", u, value)
Пример #6
0
 def solve_vertex(self, u):
     G.set_vertex_property(self, "solved", u, True)
Пример #7
0
 def select_vertex(self, u):
     G.set_vertex_property(self, "selected", u, True)