public void Teste() { AstarPlanner Planner = new AstarPlanner(); Planner.Actions.Add(new KillAction()); Planner.Actions.Add(new BeProtectedAction()); Planner.Actions.Add(new BeArmedAction()); Planner.Actions.Add(new GoToAction("lugar0", "lugar1", 2)); Planner.Actions.Add(new GoToAction("lugar1", "lugar2", 2)); Planner.Actions.Add(new GoToAction("lugar2", "lugar1", 2)); Planner.Actions.Add(new GoToAction("lugar1", "lugar0", 2)); WorldState TestWorldState = new WorldState(); TestWorldState.SetSymbol(new WorldSymbol("Armed", false)); TestWorldState.SetSymbol(new WorldSymbol("Place", "lugar0")); TestWorldState.SetSymbol(new WorldSymbol("Protected", false)); TestWorldState.SetSymbol(new WorldSymbol("EnemyKilled", false)); PlanSet PlanSet = Planner.CreatePlan( TestWorldState, new TesteGoal() ); System.Diagnostics.Debug.Assert(PlanSet != null); }
public void Teste() { AstarPlanner Planner = new AstarPlanner(); Planner.Actions.Add(new KillAction()); Planner.Actions.Add(new BeProtectedAction()); Planner.Actions.Add(new BeArmedAction()); Planner.Actions.Add(new GoToAction("lugar0", "lugar1",2)); Planner.Actions.Add(new GoToAction("lugar1", "lugar2", 2)); Planner.Actions.Add(new GoToAction("lugar2", "lugar1", 2)); Planner.Actions.Add(new GoToAction("lugar1", "lugar0", 2)); WorldState TestWorldState = new WorldState(); TestWorldState.SetSymbol(new WorldSymbol("Armed", false)); TestWorldState.SetSymbol(new WorldSymbol("Place", "lugar0")); TestWorldState.SetSymbol(new WorldSymbol("Protected", false)); TestWorldState.SetSymbol(new WorldSymbol("EnemyKilled", false)); PlanSet PlanSet = Planner.CreatePlan( TestWorldState, new TesteGoal() ); System.Diagnostics.Debug.Assert(PlanSet != null); }
public PlanSet GetPlan(Goal goal, List<PloobsEngine.IA.Action> Actions) { AstarPlanner Planner = new AstarPlanner(); Planner.MaxIteration = int.MaxValue; Planner.Actions = Actions; WorldState WorldState = BlackBoard.GetEntry<WorldState>("WorldState"); PlanSet PlanSet = Planner.CreatePlan( WorldState, goal ); return PlanSet; }
public PlanSet GetPlan(Goal goal, List <PloobsEngine.IA.Action> Actions) { AstarPlanner Planner = new AstarPlanner(); Planner.MaxIteration = int.MaxValue; Planner.Actions = Actions; WorldState WorldState = BlackBoard.GetEntry <WorldState>("WorldState"); PlanSet PlanSet = Planner.CreatePlan( WorldState, goal ); return(PlanSet); }