Esempio n. 1
0
        public void CircularityDetection()
        {
            flowEngine = new BREImpl();
            flowEngine.Init(new XBusinessRulesFileDriver(ruleFilesFolder + "/circularity.xbre"));
            backwardChainer = new BackwardChainer(flowEngine);

            Stack<string> resolutionPath = new Stack<string>();
            Assert.IsNull(backwardChainer.Resolve("A", resolutionPath));
            Assert.IsTrue(resolutionPath.Contains("{Circularity}"));
        }
Esempio n. 2
0
        /// <summary>
        /// Schedule the execution of sets to try to create the passed object ID in the rule context (backward chaining). 
        /// </summary>
        /// <param name="objectId">The ID to resolve.</param>
        /// <returns>The value of the object ID to resolve, or null if the resolution was not possible.</returns>
        public object Resolve(string objectId)
        {
            if (backwardChainer == null) {
                backwardChainer = new BackwardChainer(this);
            }

            return backwardChainer.Resolve(objectId);
        }
Esempio n. 3
0
 public void InitializeChainer()
 {
     flowEngine = new BREImpl();
     flowEngine.Init(new XBusinessRulesFileDriver(ruleFilesFolder + "/car-loan-rules.xbre"));
     backwardChainer = new BackwardChainer(flowEngine);
 }
Esempio n. 4
0
 public void InvalidRuleBase()
 {
     flowEngine = new BREImpl();
     flowEngine.Init(new XBusinessRulesFileDriver(Parameter.GetString("unittest.inputfile")));
     backwardChainer = new BackwardChainer(flowEngine);
 }