Exemplo n.º 1
0
 private void CreateAmmoFLV()
 {
     IFuzzySet[] ammoFlVFuzzySets = new IFuzzySet[3];
     ammoFlVFuzzySets[0] = new LeftShoulderFuzzySet(0, 10);
     ammoFlVFuzzySets[1] = new TriangleFuzzySet(0, 10, 30);
     ammoFlVFuzzySets[2] = new RightShoulderFuzzySet(10, 30);
     AmmoFLV             = new FuzzyLinguisticVariables(ammoFlVFuzzySets);
 }
Exemplo n.º 2
0
 private void CreateDistanceFLV()
 {
     IFuzzySet[] distanceFlVFuzzySets = new IFuzzySet[3];
     distanceFlVFuzzySets[0] = new LeftShoulderFuzzySet(25, 150);
     distanceFlVFuzzySets[1] = new TriangleFuzzySet(25, 150, 300);
     distanceFlVFuzzySets[2] = new RightShoulderFuzzySet(150, 300);
     DistanceToTargetFLV     = new FuzzyLinguisticVariables(distanceFlVFuzzySets);
 }
Exemplo n.º 3
0
        public void LeftShoulderSet()
        {
            LeftShoulderFuzzySet set = new LeftShoulderFuzzySet(0, 20);
            float dom = set.CalculateDom(0);

            Assert.AreEqual(1, dom);

            dom = set.CalculateDom(5);
            Assert.AreEqual(0.75f, dom);

            dom = set.CalculateDom(10);
            Assert.AreEqual(0.5f, dom);

            dom = set.CalculateDom(15);
            Assert.AreEqual(0.25f, dom);

            dom = set.CalculateDom(20);
            Assert.AreEqual(0, dom);

            dom = set.CalculateDom(45);
            Assert.AreEqual(0, dom);
        }