private FuzzySet <DistanceToTarget> GetDistanceToTargetSet() { IMemebershipFunction closeFx = new ShoulderMembershipFunction(0f, new Coords(25f, 1f), new Coords(150f, 0f), 400f); IMemebershipFunction mediumFx = new TriangularMemebershipFunction(new Coords(25f, 0f), new Coords(150f, 1f), new Coords(300f, 0f)); IMemebershipFunction farFx = new ShoulderMembershipFunction(0f, new Coords(150f, 0f), new Coords(300f, 1f), 400f); FuzzySet <DistanceToTarget> set = new FuzzySet <DistanceToTarget>(); set.Set(DistanceToTarget.Close, closeFx); set.Set(DistanceToTarget.Medium, mediumFx); set.Set(DistanceToTarget.Far, farFx); return(set); }
private FuzzySet <AmmoStatus> GetAmmoStatusSet() { IMemebershipFunction lowFx = new ShoulderMembershipFunction(0f, new Coords(0f, 1f), new Coords(10f, 0f), 40f); IMemebershipFunction okayFx = new TriangularMemebershipFunction(new Coords(0f, 0f), new Coords(10f, 1f), new Coords(30f, 0f)); IMemebershipFunction loadsFx = new ShoulderMembershipFunction(0f, new Coords(10f, 0f), new Coords(30f, 1f), 40f); FuzzySet <AmmoStatus> set = new FuzzySet <AmmoStatus>(); set.Set(AmmoStatus.Low, lowFx); set.Set(AmmoStatus.Okay, okayFx); set.Set(AmmoStatus.Loads, loadsFx); return(set); }
private FuzzySet <Desirability> GetDesirabilitySet() { IMemebershipFunction undesirableFx = new ShoulderMembershipFunction(0f, new Coords(25f, 1f), new Coords(50f, 0f), 100f); IMemebershipFunction desirableFx = new TriangularMemebershipFunction(new Coords(25f, 0f), new Coords(50f, 1f), new Coords(75f, 0f)); IMemebershipFunction veryDesirableFx = new ShoulderMembershipFunction(0f, new Coords(50f, 0f), new Coords(75f, 1f), 100f); FuzzySet <Desirability> set = new FuzzySet <Desirability>(); set.Set(new FuzzyVariable <Desirability>(Desirability.Undesirable, undesirableFx)); set.Set(new FuzzyVariable <Desirability>(Desirability.Desirable, desirableFx)); set.Set(new FuzzyVariable <Desirability>(Desirability.VeryDesirable, veryDesirableFx)); return(set); }