Exemplo n.º 1
0
        public RuleEngine(RuleSet ruleSet, IRuleCompiler ruleCompiler)
        {
            foreach (Rule rule in ruleSet.Rules)
            {
                RuleResult         ruleResult        = new RuleResult(rule.Code, rule.Message);
                ISpecification <T> ruleSpecification = ruleCompiler.Compile <T>(rule);

                _ruleSpecifications.Add(ruleResult, ruleSpecification);
            }
        }
Exemplo n.º 2
0
 public DefaultWM(Rete engine, RootNode node, IRuleCompiler compiler)
 {
     InitBlock();
     this.engine   = engine;
     root          = node;
     this.compiler = compiler;
     this.compiler.WorkingMemory = this;
     agenda = new Agenda(engine);
     init();
 }
Exemplo n.º 3
0
 public static CompilerProvider getInstance(IRuleCompiler ruleCompiler)
 {
     if (compilerProvider == null)
     {
         objectConditionCompiler   = new ObjectConditionCompiler(ruleCompiler);
         existConditionCompiler    = new ExistConditionCompiler(objectConditionCompiler);
         temporalConditionCompiler = new TemporalConditionCompiler(ruleCompiler);
         testConditionCompiler     = new TestConditionCompiler(ruleCompiler);
         compilerProvider          = new CompilerProvider();
     }
     return(compilerProvider);
 }
Exemplo n.º 4
0
 public static CompilerProvider getInstance(IRuleCompiler ruleCompiler)
 {
     if (compilerProvider == null)
     {
         objectConditionCompiler = new ObjectConditionCompiler(ruleCompiler);
         existConditionCompiler = new ExistConditionCompiler(objectConditionCompiler);
         temporalConditionCompiler = new TemporalConditionCompiler(ruleCompiler);
         testConditionCompiler = new TestConditionCompiler(ruleCompiler);
         compilerProvider = new CompilerProvider();
     }
     return compilerProvider;
 }
Exemplo n.º 5
0
 public ValidationProvider(ValidationGraph graph, IRuleCompiler ruleCompiler)
 {
     _graph = graph;
     _ruleCompiler = ruleCompiler;
 }
Exemplo n.º 6
0
 public virtual IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     CompilerProvider.getInstance(ruleCompiler);
     return CompilerProvider.testConditionCompiler;
 }
Exemplo n.º 7
0
 public DefaultWM(Rete engine, RootNode node, IRuleCompiler compiler)
 {
     InitBlock();
     this.engine = engine;
     root = node;
     this.compiler = compiler;
     this.compiler.WorkingMemory = this;
     agenda = new Agenda(engine);
     init();
 }
Exemplo n.º 8
0
 public TemporalConditionCompiler(IRuleCompiler ruleCompiler) : base(ruleCompiler)
 {
 }
Exemplo n.º 9
0
        /// <summary> 
        /// </summary>
        public Rete()
        {
            InitBlock();
            compiler = new DefaultRuleCompiler(this, root.ObjectTypeNodes);
            workingMem = new DefaultWM(this, root, compiler);
            //CollectionFactory.init();
            init();
            startLog();

            compiler.RuleAdded += ruleAdded;
            compiler.RuleRemoved += ruleRemoved;
            compiler.CompileError += compileError;
        }
Exemplo n.º 10
0
 public TemporalConditionCompiler(IRuleCompiler ruleCompiler)
     : base(ruleCompiler)
 {
 }
Exemplo n.º 11
0
 public virtual IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     CompilerProvider.getInstance(ruleCompiler);
     return(CompilerProvider.testConditionCompiler);
 }
Exemplo n.º 12
0
 public GrammarReader(IRuleCompiler compiler)
 {
     Compiler = compiler;
 }
Exemplo n.º 13
0
 public ObjectConditionCompiler(IRuleCompiler ruleCompiler)
 {
     this.ruleCompiler = (DefaultRuleCompiler) ruleCompiler;
 }
Exemplo n.º 14
0
 public abstract IConditionCompiler getCompiler(IRuleCompiler ruleCompiler);
Exemplo n.º 15
0
 public virtual IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     // TODO Auto-generated method stub
     return null;
 }
Exemplo n.º 16
0
 public override IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     CompilerProvider.getInstance(ruleCompiler);
     return(CompilerProvider.temporalConditionCompiler);
 }
Exemplo n.º 17
0
 public virtual IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     // TODO Auto-generated method stub
     return(null);
 }
 public ObjectConditionCompiler(IRuleCompiler ruleCompiler)
 {
     this.ruleCompiler = (DefaultRuleCompiler)ruleCompiler;
 }
Exemplo n.º 19
0
 public override IConditionCompiler getCompiler(IRuleCompiler ruleCompiler)
 {
     CompilerProvider.getInstance(ruleCompiler);
     return CompilerProvider.objectConditionCompiler;
 }