Example #1
0
        public void StateSpaceToolsGetLaterConstituentActionTest()
        {
            Plan newPlan = testPlan.Clone() as Plan;

            newPlan.Steps = new List <IOperator>
            {
                new Operator
                (
                    new Predicate("move", new List <ITerm> {
                    new Term("sam", true), new Term("woods", true), new Term("lake", true)
                }, true),
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("sam", true), new Term("woods", true)
                    }, true),
                    new Predicate("at", new List <ITerm> {
                        new Term("sam", true), new Term("lake", true)
                    }, false),
                    new Predicate("character", new List <ITerm> {
                        new Term("sam", true)
                    }, true),
                    new Predicate("alive", new List <ITerm> {
                        new Term("sam", 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("sam", true), new Term("woods", true)
                    }, false),
                    new Predicate("at", new List <ITerm> {
                        new Term("sam", 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),
                }
                ),
                new Operator
                (
                    new Predicate("take", new List <ITerm> {
                    new Term("arthur", true), new Term("excalibur", true), new Term("lake", true)
                }, true),
                    new List <IPredicate>
                {
                    new Predicate("character", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("character", new List <ITerm> {
                        new Term("excalibur", true)
                    }, false),
                    new Predicate("alive", new List <ITerm> {
                        new Term("arthur", true)
                    }, true),
                    new Predicate("at", new List <ITerm> {
                        new Term("arthur", true), new Term("lake", true)
                    }, true),
                    new Predicate("at", new List <ITerm> {
                        new Term("excalibur", true), new Term("lake", true)
                    }, true),
                },
                    new List <IPredicate>
                {
                    new Predicate("at", new List <ITerm> {
                        new Term("excalibur", true), new Term("lake", true)
                    }, false),
                    new Predicate("has", new List <ITerm> {
                        new Term("arthur", true), new Term("excalibur", true)
                    }, true),
                }
                )
            };

            Assert.AreEqual("move", StateSpaceTools.GetConstituentAction(testDomain, testProblem, newPlan, testState).Action.Name);
        }
Example #2
0
        public void StateSpaceToolsGetConstituentActionTest()
        {
            string constituentActionName = StateSpaceTools.GetConstituentAction(testDomain, testProblem, testPlan, testState).Action.Name;

            Assert.AreEqual("move", constituentActionName);
        }