public static void AddObservedNegativeConditions(UnityProblemCompiler UPC)
        {
            foreach (var ga in GroundActionFactory.GroundActions)
            {
                foreach (var precon in ga.Preconditions)
                {
                    // if the precon is signed positive, ignore
                    if (precon.Sign)
                    {
                        continue;
                    }
                    // if initially the precondition reveresed is true, ignore
                    if (UPC.initialPredicateList.Contains(precon.GetReversed()))
                    {
                        continue;
                    }

                    // then this precondition is negative and its positive correlate isn't in the initial state
                    var obsPred = new Predicate("obs", new List <ITerm>()
                    {
                        precon as ITerm
                    }, true);

                    if (UPC.initialPredicateList.Contains(obsPred as IPredicate))
                    {
                        continue;
                    }

                    UPC.initialPredicateList.Add(obsPred as IPredicate);
                }
            }
        }
示例#2
0
        public static void CreateSteps(UnityProblemCompiler UPC, List <UnityTimelineDecomp> DecompositionSchemata)
        {
            foreach (var unitydecomp in DecompositionSchemata)
            {
                if (unitydecomp.NumGroundDecomps == 0)
                {
                    unitydecomp.Read();
                    unitydecomp.Assemble();
                    unitydecomp.Filter();
                    Debug.Log("Read,Assemble, and Filter for unity decomp: " + unitydecomp.name);
                }
            }
            var compositeSteps = GroundDecompositionsToCompositeSteps(DecompositionSchemata);

            AddCompositeStepsToGroundActionFactory(UPC.initialPredicateList, UPC.goalPredicateList, compositeSteps);
        }