public override bool Equals(object obj) { if (obj is Antecedent) { Antecedent antecedent = obj as Antecedent; foreach (Judgment currentJudgment in this.JudgmentList) { Boolean hasJudgment = false; foreach (Judgment judgment in antecedent.JudgmentList) { if (currentJudgment.Equals(judgment)) { hasJudgment = true; break; } } if (!hasJudgment) { return(false); } } return(true); } else { throw new ArgumentException(); } }
private Rule GetRule18() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.AmbientTemperature, EvaluationValue.Normal)); consequent = new Consequent(new Judgment(FactorName.Generator, EvaluationValue.CheckAmbientTemperature)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule9() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.OilInCan, EvaluationValue.AddOilInCan)); consequent = new Consequent(new Judgment(FactorName.OilInCan, EvaluationValue.NotEmpty)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule17() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.Heater, EvaluationValue.SwitchOff)); consequent = new Consequent(new Judgment(FactorName.AmbientTemperature, EvaluationValue.Normal)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule12() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.FuelInTank, EvaluationValue.AddFuelInTank)); consequent = new Consequent(new Judgment(FactorName.FuelInTank, EvaluationValue.NotEmpty)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule8() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.FlapPosition, EvaluationValue.CloseFlap)); consequent = new Consequent(new Judgment(FactorName.FlapPosition, EvaluationValue.Close)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule7() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new Judgment(FactorName.ConnectedDevices, EvaluationValue.DisconnectDevices)); consequent = new Consequent(new Judgment(FactorName.ConnectedDevices, EvaluationValue.Empty)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule1() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new List <Judgment> { new Judgment(FactorName.OilInTank, EvaluationValue.Empty), new Judgment(FactorName.OilInCan, EvaluationValue.Empty) }); consequent = new Consequent(new Judgment(FactorName.OilInCan, EvaluationValue.AddOilInCan)); return(new SimpleRule(antecedent, consequent)); }
private Rule GetRule13() { Antecedent antecedent; Consequent consequent; antecedent = new Antecedent(new List <Judgment> { new Judgment(FactorName.OilInTank, EvaluationValue.NotEmpty), new Judgment(FactorName.FuelInTank, EvaluationValue.NotEmpty), new Judgment(FactorName.ConnectedDevices, EvaluationValue.Empty), new Judgment(FactorName.FlapPosition, EvaluationValue.Close) }); consequent = new Consequent(new Judgment(FactorName.Generator, EvaluationValue.Done)); return(new SimpleRule(antecedent, consequent)); }
public CompoundRule(Antecedent antecedent, Consequent consequent) : base(antecedent, consequent) { this.childRules = new List <Rule>(); }
public SimpleRule(Antecedent antecedent, Consequent consequent) : base(antecedent, consequent) { }
public Rule(Antecedent antecedent, Consequent consequent) { this.antecedent = antecedent; this.consequent = consequent; }