protected Rule ruleMatch(ObjectWithDynamicAttributes state,
			Set<Rule> rulesSet) {
		foreach (Rule r in rulesSet) {
			if (r.evaluate(state)) {
				return r;
			}
		}
		return null;
	}
예제 #2
0
        public ObjectWithDynamicAttributes copy()
        {
            ObjectWithDynamicAttributes copy = null;

            try {
                copy = (ObjectWithDynamicAttributes)this.GetType().GetConstructor(System.Type.EmptyTypes).Invoke(null);
                foreach (object val in attributes)
                {
                    copy.attributes.Add(val, attributes[val]);
                }
            } catch (Exception ex) {
                Debug.WriteLine(ex.ToString());
            }

            return(copy);
        }
예제 #3
0
	public override bool evaluate(ObjectWithDynamicAttributes p) {
		return (left.evaluate(p) && right.evaluate(p));
	}
예제 #4
0
파일: Rule.cs 프로젝트: PaulMineau/AIMA.Net
	public bool evaluate(ObjectWithDynamicAttributes p) {
		return (con.evaluate(p));
	}
예제 #5
0
	public override bool evaluate(ObjectWithDynamicAttributes p) {
		return value.Equals(p.getAttribute(key));
	}
예제 #6
0
	public override bool evaluate(ObjectWithDynamicAttributes p) {
		return (!con.evaluate(p));
	}
예제 #7
0
	public abstract bool evaluate(ObjectWithDynamicAttributes p);