# Path: misc/objects.py
# def str_object(obj):
#   if type(obj) in (list, np.ndarray):
#     return '[%s]' % ', '.join(str_object(item) for item in obj)
#   if type(obj) == tuple:
#     return '(%s)' % ', '.join(str_object(item) for item in obj)
#   if type(obj) == dict:
#     return '{%s}' % ', '.join(str_object(item) + ': ' +  str_object(obj[item])
#                               for item in sorted(obj.keys(), key=lambda k: str_object(k)))
#   if type(obj) in (set, frozenset):
#     return '{%s}' % ', '.join(sorted(str_object(item) for item in obj))
#   if type(obj) in (float, np.float64):
#     obj = round(obj, 3)
#     if obj == 0:
#       obj = 0 # NOTE - catches -0.0 bug
#     return '%.3f'%obj
#   if isinstance(obj, types.FunctionType):
#     return obj.__name__
#   return str(obj)


from .utils import *
from misc.objects import str_object
    self.condition = condition
    self.rg = rg
    self.vertices = set()
    self.edges = set()
    self.subplanners = None
    self.reachable = False
    self.active = False

  def satisfies(self, vertex):
    return vertex.substate in self.condition

  def connect(self, edge):
    # TODO - check that the connector belongs to the edge
    if edge not in self.edges: # This actually won't matter
      self.edges.add(edge)
      edge.connectors.append(self)

      if edge.active and not self.active:
        edge.set_active_next_connector() # self.set_active()
      if self.reachable and not edge.reachable:
        edge.num_reachable += 1
        if edge.num_reachable == len(edge.value.conditions):
          edge.set_reachable()
        elif DELAYED_ACTIVATION:
          edge.set_active_next_connector()

  def set_reachable(self):
    if self.reachable: return
    self.reachable = True


# Path: misc/objects.py
# def str_object(obj):
#   if type(obj) in (list, np.ndarray):
#     return '[%s]' % ', '.join(str_object(item) for item in obj)
#   if type(obj) == tuple:
#     return '(%s)' % ', '.join(str_object(item) for item in obj)
#   if type(obj) == dict:
#     return '{%s}' % ', '.join(str_object(item) + ': ' +  str_object(obj[item])
#                               for item in sorted(obj.keys(), key=lambda k: str_object(k)))
#   if type(obj) in (set, frozenset):
#     return '{%s}' % ', '.join(sorted(str_object(item) for item in obj))
#   if type(obj) in (float, np.float64):
#     obj = round(obj, 3)
#     if obj == 0:
#       obj = 0 # NOTE - catches -0.0 bug
#     return '%.3f'%obj
#   if isinstance(obj, types.FunctionType):
#     return obj.__name__
#   return str(obj)


# Path: retired/planners/reachability_graph/connector.py
from .utils import *
from misc.objects import str_object

    self.condition = condition
    self.rg = rg
    self.vertices = set()
    self.edges = set()
    self.subplanners = None
    self.reachable = False
    self.active = False

  def satisfies(self, vertex):
    return vertex.substate in self.condition

  def connect(self, edge):
    # TODO - check that the connector belongs to the edge
    if edge not in self.edges: # This actually won't matter
      self.edges.add(edge)
      edge.connectors.append(self)

      if edge.active and not self.active:
        edge.set_active_next_connector() # self.set_active()
      if self.reachable and not edge.reachable:
        edge.num_reachable += 1
        if edge.num_reachable == len(edge.value.conditions):
          edge.set_reachable()
        elif DELAYED_ACTIVATION:
          edge.set_active_next_connector()

  def set_reachable(self):
    if self.reachable: return
    self.reachable = True


    if PRUNE_INACTIVE and self.rg.greedy: