private void UpdateMoveEvaluators() { foreach (ISingleObjectiveTestFunctionMoveEvaluator op in Operators.OfType <ISingleObjectiveTestFunctionMoveEvaluator>().ToList()) { Operators.Remove(op); } foreach (ISingleObjectiveTestFunctionMoveEvaluator op in ApplicationManager.Manager.GetInstances <ISingleObjectiveTestFunctionMoveEvaluator>()) { if (op.EvaluatorType == Evaluator.GetType()) { Operators.Add(op); #region Synchronize evaluator specific parameters with the parameters of the corresponding move evaluators if (op is ISphereMoveEvaluator) { SphereEvaluator e = (Evaluator as SphereEvaluator); e.AlphaParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged); e.CParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged); ISphereMoveEvaluator em = (op as ISphereMoveEvaluator); em.C = e.C; em.Alpha = e.Alpha; } else if (op is IRastriginMoveEvaluator) { RastriginEvaluator e = (Evaluator as RastriginEvaluator); e.AParameter.ValueChanged += new EventHandler(RastriginEvaluator_Parameter_ValueChanged); IRastriginMoveEvaluator em = (op as IRastriginMoveEvaluator); em.A = e.A; } #endregion } } ParameterizeOperators(); OnOperatorsChanged(); }
private void RastriginEvaluator_Parameter_ValueChanged(object sender, EventArgs e) { RastriginEvaluator eval = (Evaluator as RastriginEvaluator); if (eval != null) { foreach (IRastriginMoveEvaluator op in Operators.OfType <IRastriginMoveEvaluator>()) { op.A = eval.A; } } }
protected override double Evaluate(double quality, RealVector point, AdditiveMove move) { RealVectorAdditiveMoveWrapper wrapper = new RealVectorAdditiveMoveWrapper(move, point); return(RastriginEvaluator.Apply(wrapper, A.Value)); }
protected RastriginEvaluator(RastriginEvaluator original, Cloner cloner) : base(original, cloner) { }