# Path: retired/discrete/operators.py
# def add_operator_transitions(operator, transitions):
#   for variable, (start, end) in transitions.items():
#     if start is not None:
#       operator.conditions.append(SubstateCondition(Substate({variable: start})))
#     if end is not None:
#       operator.effects[variable] = ValueEffect(end)
# 
# Path: planner/operators.py
# class Action(Operator):
#   cost = 1
# 
# Path: misc/utils.py
# SEPARATOR = '\n'+85*'-'+'\n'
# def arg_info(frame, ignore=['self']):
# def function_name(stack): # NOTE - stack = inspect.stack()
# def get_path(frame):
# def get_directory(abs_path):
# def global_fn(name):
# def refresh(module_name):


from retired.discrete.operators import add_operator_transitions
from planner.operators import Action
from misc.utils import arg_info, currentframe

class Pick(Action):
  def __init__(self, obj):
    super(self.__class__, self).__init__(arg_info(currentframe()))
    add_operator_transitions(self, {
      ('on', obj): ('table', False),
      ('clear', obj): (True, None),
      'holding': (False, obj),
    })


# Path: retired/discrete/operators.py
# def add_operator_transitions(operator, transitions):
#   for variable, (start, end) in transitions.items():
#     if start is not None:
#       operator.conditions.append(SubstateCondition(Substate({variable: start})))
#     if end is not None:
#       operator.effects[variable] = ValueEffect(end)
# 
# Path: planner/operators.py
# class Action(Operator):
#   cost = 1
# 
# Path: misc/utils.py
# SEPARATOR = '\n'+85*'-'+'\n'
# def arg_info(frame, ignore=['self']):
# def function_name(stack): # NOTE - stack = inspect.stack()
# def get_path(frame):
# def get_directory(abs_path):
# def global_fn(name):
# def refresh(module_name):


# Path: retired/discrete/blocks_world/operators.py
from retired.discrete.operators import add_operator_transitions
from planner.operators import Action
from misc.utils import arg_info, currentframe


class Pick(Action):
  def __init__(self, obj):
    super(self.__class__, self).__init__(arg_info(currentframe()))
    add_operator_transitions(self, {
      ('on', obj): ('table', False),
      ('clear', obj): (True, None),
      'holding': (False, obj),
    })


class Place(Action):