private void KormiloRuleBook() { KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(60))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-60)), Rule.UKOR.IndexOfElement(DomainElement.Of(-45)), Rule.UKOR.IndexOfElement(DomainElement.Of(-30))) //umjeren udesno ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(50)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.GammaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(70)), Rule.UANTEC.IndexOfElement(DomainElement.Of(90))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(75)), Rule.UANTEC.IndexOfElement(DomainElement.Of(135))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-90)), Rule.UKOR.IndexOfElement(DomainElement.Of(-80)), Rule.UKOR.IndexOfElement(DomainElement.Of(-55))) //ostro udesno ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(60))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(30)), Rule.UKOR.IndexOfElement(DomainElement.Of(45)), Rule.UKOR.IndexOfElement(DomainElement.Of(60))) //umjeren ulijevo ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.GammaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(70)), Rule.UANTEC.IndexOfElement(DomainElement.Of(90))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(50)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(75)), Rule.UANTEC.IndexOfElement(DomainElement.Of(135))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(55)), Rule.UKOR.IndexOfElement(DomainElement.Of(80)), Rule.UKOR.IndexOfElement(DomainElement.Of(90))) //ostro ulijevo ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(30)), Rule.UANTEC.IndexOfElement(DomainElement.Of(50))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(30)), Rule.UANTEC.IndexOfElement(DomainElement.Of(60))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.LFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-80)), Rule.UKOR.IndexOfElement(DomainElement.Of(-25))) //ostro udesno vrlo blizu lijevo neovisno o brzini ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(30)), Rule.UANTEC.IndexOfElement(DomainElement.Of(50))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(30)), Rule.UANTEC.IndexOfElement(DomainElement.Of(60))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensKor(StandardFuzzySets.GammaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(25)), Rule.UKOR.IndexOfElement(DomainElement.Of(80))) //ostro ulijevo vrlo blizu desno neovisno o brzini ) ) ); KormiloRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-2)), Rule.UKOR.IndexOfElement(DomainElement.Of(0)), Rule.UKOR.IndexOfElement(DomainElement.Of(1))) ), Rule.MakeFuzzyRuleConsequensAcc(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-90)), Rule.UKOR.IndexOfElement(DomainElement.Of(-85)), Rule.UKOR.IndexOfElement(DomainElement.Of(-80))) ) //rotiraj ) ); }
private void AkcelRuleBook() { AkcelRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(50)), Rule.UANTEC.IndexOfElement(DomainElement.Of(75))) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleConsequensAcc(StandardFuzzySets.LambdaFunction( Rule.UACC.IndexOfElement(DomainElement.Of(0)), Rule.UACC.IndexOfElement(DomainElement.Of(10)), Rule.UACC.IndexOfElement(DomainElement.Of(20))) ) //ubrzaj do 75 ) ); AkcelRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), //vrlo blizu obali lijevo Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), //nebitno desno Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), //vrlo blizu LK Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.GammaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(80)), Rule.UANTEC.IndexOfElement(DomainElement.Of(200))) ), //umjereno blizu LK Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(65)), Rule.UANTEC.IndexOfElement(DomainElement.Of(135))) //do cca 90 px/s ), //velika brzina Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), //nebitno S?? //TODO mozda popraviti domenu od S Rule.MakeFuzzyRuleConsequensAcc(StandardFuzzySets.LambdaFunction( Rule.UACC.IndexOfElement(DomainElement.Of(-30)), Rule.UACC.IndexOfElement(DomainElement.Of(-22)), Rule.UACC.IndexOfElement(DomainElement.Of(0))) ) //zavoj ) ); AkcelRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), //nebitno lijevo Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), //umjereno blizu desno Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.GammaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(80)), Rule.UANTEC.IndexOfElement(DomainElement.Of(200))) ), //umjereno blizu LK Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(0)), Rule.UANTEC.IndexOfElement(DomainElement.Of(80))) ), //umjereno blizu DK Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UANTEC.IndexOfElement(DomainElement.Of(35)), Rule.UANTEC.IndexOfElement(DomainElement.Of(65)), Rule.UANTEC.IndexOfElement(DomainElement.Of(135))) //do cca 90 px/s ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), //nebitno S?? //TODO mozda popraviti domenu od S Rule.MakeFuzzyRuleConsequensAcc(StandardFuzzySets.LambdaFunction( Rule.UACC.IndexOfElement(DomainElement.Of(-30)), Rule.UACC.IndexOfElement(DomainElement.Of(-22)), Rule.UACC.IndexOfElement(DomainElement.Of(0))) ) //zavoj ) ); AkcelRules.Add( new Rule( Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.UniversalFunction( 1) ), Rule.MakeFuzzyRuleAntecedent(StandardFuzzySets.LambdaFunction( Rule.UKOR.IndexOfElement(DomainElement.Of(-1)), Rule.UKOR.IndexOfElement(DomainElement.Of(0)), Rule.UKOR.IndexOfElement(DomainElement.Of(1))) ), Rule.MakeFuzzyRuleConsequensAcc(StandardFuzzySets.LambdaFunction( Rule.UACC.IndexOfElement(DomainElement.Of(-30)), Rule.UACC.IndexOfElement(DomainElement.Of(-22)), Rule.UACC.IndexOfElement(DomainElement.Of(0))) ) //rotiraj ) ); }