def write_pddl(domain_pddl=None, problem_pddl=None, temp_dir=TEMP_DIR): clear_dir(temp_dir) domain_path = os.path.join(temp_dir, DOMAIN_INPUT) if domain_pddl is not None: write(domain_path, domain_pddl) problem_path = os.path.join(temp_dir, PROBLEM_INPUT) if problem_pddl is not None: write(problem_path, problem_pddl) return domain_path, problem_path
def translate_and_write_task(task, temp_dir): #sas_task = pddl_to_sas(instantiate_task(task)) normalize.normalize(task) sas_task = translate.pddl_to_sas(task) #try: # sas_task = translate.pddl_to_sas(task) #except AssertionError: # raise AssertionError('A function is not defined for some grounding of an action') translate.dump_statistics(sas_task) clear_dir(temp_dir) with open(os.path.join(temp_dir, TRANSLATE_OUTPUT), "w") as output_file: sas_task.output(output_file) return sas_task
def reset_visualizations(): clear_dir(VISUALIZATIONS_DIR) ensure_dir(CONSTRAINT_NETWORK_DIR) ensure_dir(STREAM_PLAN_DIR)
def write_sas_task(sas_task, temp_dir): clear_dir(temp_dir) translate_path = os.path.join(temp_dir, TRANSLATE_OUTPUT) with open(os.path.join(temp_dir, TRANSLATE_OUTPUT), "w") as output_file: sas_task.output(output_file) return translate_path
def clear_visualizations(): clear_dir(CONSTRAINT_NETWORK_DIR) clear_dir(STREAM_PLAN_DIR)