public void GetImplications_GetPossibleFutureStates_Simple_Test()
        {
            var leaf = new Vertex(_state, action_A_2, 10, null);

            var implication = _worldDescription.GetImplications(leaf, 0);

            Assert.AreEqual(1, implication.Count);
            Assert.NotNull(implication[0].FutureState);
            var futureState = implication[0].FutureState;

            Assert.IsTrue(futureState.Fluents.First(t => t.Name == "a").Value);
            Assert.IsFalse(futureState.Fluents.First(t => t.Name == "b").Value);
            Assert.IsTrue(futureState.Fluents.First(t => t.Name == "c").Value);
            Assert.IsTrue(futureState.Fluents.First(t => t.Name == "e").Value);
        }
Esempio n. 2
0
        internal List <Vertex> GenerateChildsForLeaf(WorldDescription worldDescription, ScenarioDescription scenarioDescription, int TInf)
        {
            List <Vertex> vertices = new List <Vertex>();

            int nextTime = GetNextTimestamp(scenarioDescription, TInf);

            if (!CheckNearestObservations(scenarioDescription, nextTime))
            {
                return(GetImpossibleChilds());
            }

            var         implications = worldDescription.GetImplications(this, nextTime);
            WorldAction nextAction   = scenarioDescription.GetActionAtTime(nextTime);

            vertices = CreateChildsBasedOnImplications(implications, nextAction, nextTime);

            return(vertices);
        }