Esempio n. 1
0
 public void PlanSimulatorVerifyPlanTest()
 {
     Assert.IsTrue(PlanSimulator.VerifyPlan(testPlan, testPlan.Initial as State, new List <IObject>
     {
         new Obj("arthur", ""),
         new Obj("woods", ""),
         new Obj("lake", ""),
         new Obj("excalibur", "")
     }));
 }
Esempio n. 2
0
        public void PlanSimulatorVerifyPlanTestFalse()
        {
            Plan newPlan = testPlan.Clone() as Plan;

            newPlan.Steps = new List <IOperator>
            {
                new Operator
                (
                    new Predicate("move", new List <ITerm> {
                    new Term("arthur", true), new Term("woods", true), new Term("lake", true)
                }, true),
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("woods", true)
                    }, true),
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("lake", true)
                    }, false),
                    new Predicate("character", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("alive", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("location", new List <ITerm> {
                        new Term("woods", true)
                    }, true),
                    new Predicate("location", new List <ITerm> {
                        new Term("lake", true)
                    }, true),
                    new Predicate("connected", new List <ITerm> {
                        new Term("lake", true), new Term("woods", true)
                    }, true),
                },
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("woods", true)
                    }, false),
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("lake", true)
                    }, true),
                }
                ),
                new Operator
                (
                    new Predicate("move", new List <ITerm> {
                    new Term("arthur", true), new Term("woods", true), new Term("lake", true)
                }, true),
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("woods", true)
                    }, true),
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("lake", true)
                    }, false),
                    new Predicate("character", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("alive", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("location", new List <ITerm> {
                        new Term("woods", true)
                    }, true),
                    new Predicate("location", new List <ITerm> {
                        new Term("lake", true)
                    }, true),
                    new Predicate("connected", new List <ITerm> {
                        new Term("lake", true), new Term("woods", true)
                    }, true),
                },
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("woods", true)
                    }, false),
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("lake", true)
                    }, true),
                }
                )
            };
            Assert.IsFalse(PlanSimulator.VerifyPlan(newPlan, newPlan.Initial as State, new List <IObject>
            {
                new Obj("arthur", ""),
                new Obj("woods", ""),
                new Obj("lake", ""),
                new Obj("excalibur", "")
            }));
        }