/// <summary> /// Create a complexgoal /// </summary> /// <returns>A complexgoal</returns> public override ComplexGoal CreateGoal() { var complexGoal = new ComplexGoal(); complexGoal.Goals.Add(new SimpleGoal(new Fact(Definitions.In, new ValueParameter(X), new ValueParameter(Y)))); return(complexGoal); }
public void Setup() { _desire = new Mock <ADesire>(); _desire.Setup(x => x.CreateGoal()).Returns(_goal); var intent = new Intention <AnAction, AnAgent, AnEnvironment>(_desire.Object); _result = intent.CreateGoal(); }
private ComplexGoal CreateComplexGoalForIntentions() { var complexGoal = new ComplexGoal(); foreach (var intent in CurrentIntentions) { complexGoal.Goals.AddRange(intent.CreateGoal().Goals); } return(complexGoal); }
/// <summary> /// Creation of a plan for the current intention /// </summary> /// <returns>A STRIPS plan which can be executed</returns> protected virtual Plan <TAction> MakePlan() { var itemsToProcess = new Stack <IStackItem>(); var complexGoal = new ComplexGoal(); foreach (var intent in CurrentIntentions) { complexGoal.Goals.AddRange(intent.CreateGoal().Goals); } itemsToProcess.Push(complexGoal); var currentBeliefs = ExtractFactsFromBeliefBase(); var tuple = Planner.CreatePlan <TAction>(itemsToProcess, currentBeliefs, new List <Fact>(), new List <State>(), Actions); return(tuple.Item1); }
/// <summary> /// From a desire, we create a complex goal /// </summary> /// <returns>A complex goal to be used in STRIPS</returns> public override ComplexGoal CreateGoal() { var complexGoal = new ComplexGoal(); var stacks = Target.GetStacks(); foreach (var stack in stacks) { stack.Reverse(); foreach (var block in stack) { if (block == stack.First()) { complexGoal.Goals.Add(new SimpleGoal(new Fact(Definitions.Clear, new ValueParameter(block)))); } complexGoal.Goals.Add(new SimpleGoal(new STRIPS.Fact(Definitions.On, new ValueParameter(block), new ValueParameter(block.Lower)))); } } return(complexGoal); }