Consult() public method

Load assertions into the KB
public Consult ( Stream stream ) : void
stream Stream
return void
Ejemplo n.º 1
0
        private void MakeKB()
        {
            var parent   = transform.parent;
            KB  parentKB = null;

            if (parent != null)
            {
                parentKB = parent.GetComponent <KB>();
            }

            kb = IsGlobal?
                 KnowledgeBase.Global
                : new KnowledgeBase(
                gameObject.name,
                gameObject,
                parentKB == null ? GameObject.Find(GlobalKBGameObjectName).KnowledgeBase() : parentKB.KnowledgeBase);

            // Add UID counter.
            ELNode.Store(kb.ELRoot / Symbol.Intern("next_uid") % 0);

            try
            {
                foreach (var file in SourceFiles)
                {
                    kb.Consult(file);
                }
            }
            catch (Exception)
            {
                Debug.Break(); // Pause the game
                throw;
            }
        }
Ejemplo n.º 2
0
        private void MakeKB()
        {
            var parent = transform.parent;
            KB parentKB = null;
            if (parent != null)
            {
                parentKB = parent.GetComponent<KB>();
            }

            kb = IsGlobal?
                KnowledgeBase.Global
                : new KnowledgeBase(
                    gameObject.name,
                    gameObject,
                    parentKB == null ? GameObject.Find(GlobalKBGameObjectName).KnowledgeBase() : parentKB.KnowledgeBase);

            // Add UID counter.
            ELNode.Store(kb.ELRoot/Symbol.Intern("next_uid")%0);

            try
            {
                foreach (var file in SourceFiles)
                    kb.Consult(file);
            }
            catch (Exception)
            {
                Debug.Break(); // Pause the game
                throw;
            }
        }
Ejemplo n.º 3
0
 private Playset(string path)
 {
     KnowledgeBase = new KnowledgeBase(Path.GetFileNameWithoutExtension(path), null);
     KnowledgeBase.Consult(Path.Combine(Application.dataPath, "Solver.prolog"));
     KnowledgeBase.Consult(path);
 }