internal static bool RunProblem(string mainPath) { string filePathProblem = mainPath + "p.pddl"; string filePathDomain = mainPath + "d.pddl"; Domain d = Parser.ParseDomain(filePathDomain, "agent"); Problem p = Parser.ParseProblem(filePathProblem, d); IterativeMAPlanner ma_planner = new IterativeMAPlanner(d, p, SDRPlanner.Planners.FF); var result = ma_planner.Plan(); foreach (var res in result) { string plan = PlanTreePrinter.Print(res.Value.Plan); File.WriteAllText(mainPath + "plan_" + res.Key.Name + ".txt", plan); } bool isValid = CheckMAPlan.IsValid2(d, p, result); return(isValid); }
private void RunTest(string ProblemPath) { string main_path = ProblemPath; string filePathProblem = main_path + "p.pddl"; string filePathDomain = main_path + "d.pddl"; Domain d = Parser.ParseDomain(filePathDomain, "rover"); Problem p = Parser.ParseProblem(filePathProblem, d); IterativeMAPlanner ma_planner = new IterativeMAPlanner(d, p, SDRPlanner.Planners.FF); var result = ma_planner.Plan(); foreach (var res in result) { string plan = PlanTreePrinter.Print(res.Value.Plan); File.WriteAllText(main_path + "plan_" + res.Key.Name + ".txt", plan); } bool isValid = CheckMAPlan.IsValid(result); Console.WriteLine("Is valid? " + isValid); Console.WriteLine("Done"); }
public void RunPP_TableMoving_TestT2() { string main_path = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName + @"\PlanningProblems\TableMoving\T2\"; string filePathProblem = main_path + "p.pddl"; string filePathDomain = main_path + "d.pddl"; Domain d = Parser.ParseDomain(filePathDomain, "agent"); Problem p = Parser.ParseProblem(filePathProblem, d); IterativeMAPlanner ma_planner = new IterativeMAPlanner(d, p, SDRPlanner.Planners.FF); var result = ma_planner.Plan(); foreach (var res in result) { string plan = PlanTreePrinter.Print(res.Value.Plan); File.WriteAllText(main_path + "plan_" + res.Key.Name + ".txt", plan); } bool isValid = CheckMAPlan.IsValid(result); Console.WriteLine("Is valid? " + isValid); Console.WriteLine("Done"); }