# 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
#!/usr/bin/env python

from __future__ import print_function


def solve(problem_name, print_profile=False):
  dt = datetime.datetime.now()
  directory = './simulations/discrete/planning/{}/{}/{}/'.format(
      problem_name, dt.strftime('%Y-%m-%d'), dt.strftime('%H-%M-%S'))
  start, goal, Scheduler = getattr(problems, problem_name)()

# 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

#!/usr/bin/env python

from __future__ import print_function


def solve(problem_name, print_profile=False):
  dt = datetime.datetime.now()
  directory = './simulations/discrete/planning/{}/{}/{}/'.format(
      problem_name, dt.strftime('%Y-%m-%d'), dt.strftime('%H-%M-%S'))
  start, goal, Scheduler = getattr(problems, problem_name)()

  generator = default_scheduler_generator(goal, Scheduler)