# Path: planner/main.py
# def default_plan(start, goal, generator, search=False, meta=None, debug=False):
#   search = default_search(search, debug)
#   if meta is not None:
#     meta = default_meta(meta)
#     return meta(start, goal, generator, search)
#   return search(start, goal, generator)
# 
# Path: retired/planners/main.py
# def default_scheduler_generator(goal, Scheduler):
#   connectivity_graph = RelaxedConnectivityGraph(goal, Scheduler)
#   heuristic = h_ff_add
#   helpful_actions = ha_achieving_macro_sorted # ha_relaxed_plan_action_macro_sorted | ha_achieving_macro_sorted
#   max_time = INF
#   max_iterations = INF
#   max_cycles = INF
#   max_generations = INF
#   greedy = False
#   return lambda vertex: connectivity_generator(vertex, connectivity_graph, heuristic, helpful_actions,
#       max_time=max_time, max_iterations=max_iterations, max_cycles=max_cycles, max_generations=max_generations, greedy=greedy)


from misc.utils import *
from planner.main import default_plan
from retired.planners.main import default_scheduler_generator
import retired.discrete.problems as problems
import sys
import getopt
import datetime
  (plan_data, search_data), profile_output = profile(execute, filename=directory+'profile')
  print('Wrote', directory+'profile')
  print(SEPARATOR)

  if plan_data is None:
    data = str_line('Could not find plan\n')
  else:
    data = str(plan_data)
  data += '\n' + str(search_data)
  print(data)
  write(directory + 'planner_statistics', data)
  print('Wrote', directory+'planner_statistics')

  if print_profile:
    print(SEPARATOR)
    print(profile_output)
  print(SEPARATOR)

###########################################################################

HELP_MESSAGE = 'python %s -p <problem>'%(__file__)

def main(argv):
  try:
    opts, args = getopt.getopt(argv, 'hp:q', ['help', 'problem=', 'profile'])
  except getopt.GetoptError:
    print(HELP_MESSAGE)
    return

  problem_name = None

# Path: planner/main.py
# def default_plan(start, goal, generator, search=False, meta=None, debug=False):
#   search = default_search(search, debug)
#   if meta is not None:
#     meta = default_meta(meta)
#     return meta(start, goal, generator, search)
#   return search(start, goal, generator)
# 
# Path: retired/planners/main.py
# def default_scheduler_generator(goal, Scheduler):
#   connectivity_graph = RelaxedConnectivityGraph(goal, Scheduler)
#   heuristic = h_ff_add
#   helpful_actions = ha_achieving_macro_sorted # ha_relaxed_plan_action_macro_sorted | ha_achieving_macro_sorted
#   max_time = INF
#   max_iterations = INF
#   max_cycles = INF
#   max_generations = INF
#   greedy = False
#   return lambda vertex: connectivity_generator(vertex, connectivity_graph, heuristic, helpful_actions,
#       max_time=max_time, max_iterations=max_iterations, max_cycles=max_cycles, max_generations=max_generations, greedy=greedy)


# Path: retired/solve_discrete.py
from misc.utils import *
from planner.main import default_plan
from retired.planners.main import default_scheduler_generator
import retired.discrete.problems as problems
import sys
import getopt
import datetime

  (plan_data, search_data), profile_output = profile(execute, filename=directory+'profile')
  print('Wrote', directory+'profile')
  print(SEPARATOR)

  if plan_data is None:
    data = str_line('Could not find plan\n')
  else:
    data = str(plan_data)
  data += '\n' + str(search_data)
  print(data)
  write(directory + 'planner_statistics', data)
  print('Wrote', directory+'planner_statistics')

  if print_profile:
    print(SEPARATOR)
    print(profile_output)
  print(SEPARATOR)

###########################################################################

HELP_MESSAGE = 'python %s -p <problem>'%(__file__)

def main(argv):
  try:
    opts, args = getopt.getopt(argv, 'hp:q', ['help', 'problem=', 'profile'])
  except getopt.GetoptError:
    print(HELP_MESSAGE)
    return

  problem_name = None

  print_profile = False