public GoalScorer(GoalXDistance xDistance, GoalYDistance yDistance, GoalConsequence consequence) { _x_distance = xDistance; _y_distance = yDistance; _consequence = consequence; _rule_base = new EvaluationTreeRuleBase( new List <FuzzySet <IInputFuzzyMember> >() { _x_distance, _y_distance }, Consequence, CreateRules()); _fls = new FuzzyLogicSystem(new Fuzzifier(), new CenterOfSumsDefuzzifier(), _rule_base); }
// Use this for initialization void Start() { int NumberOfRobots = GameObject.Find("ConfigurationHolder")?.GetComponent <ConfigurationHolder>()?.c?.NumberOfRobots ?? 3; if (GameObject.Find("ConfigurationHolder")?.GetComponent <ConfigurationHolder>() == null) { IsOptimizationMode = true; } GoalXDistance xDistance; GoalYDistance yDistance; var consequence = new GoalConsequence(3); switch (NumberOfRobots) { case 3: xDistance = new SmallGoalXDistance(1); yDistance = new SmallGoalYDistance(2); break; case 5: xDistance = new MiddleGoalXDistance(1); yDistance = new MiddleGoalYDistance(2); break; case 11: xDistance = new LargeGoalXDistance(1); yDistance = new LargeGoalYDistance(2); break; default: xDistance = new SmallGoalXDistance(1); yDistance = new SmallGoalYDistance(2); break; } _scorer = new GoalScorer(xDistance, yDistance, consequence); }