public void Evaluate(ICandidate candidate) { // use starting _ for PascalCase conversion purposes EvaluationDelegate _evaluation = GetEvaluationDelegate(); _evaluation(candidate); }
/** Constructor */ public BehaviorNodeConditional(BehaviorNode ifTrue, BehaviorNode ifFalse, EvaluationDelegate eval, String name, bool debugPrint) { _ifTrue = ifTrue; _ifFalse = ifFalse; _eval = eval; _debugPrint = debugPrint; _name = name; }
public GeneticAlgorithm(int populationSize, int chromosomeLength, int numberOfGenerations, double crossoverRate, double mutationRate, EvaluationDelegate fitnessFunction, BoundPair[] genesDomain, int elitismFactor = 0, SelectionMode Selection = SelectionMode.RouletteWheel, bool PrintLogMode = false) { this.populationSize = populationSize; this.chromosomeLength = chromosomeLength; this.numberOfGenerations = numberOfGenerations; this.crossoverRate = crossoverRate; this.mutationRate = mutationRate; this.fitnessFunction = fitnessFunction; this.genesDomain = genesDomain; this.elitismFactor = elitismFactor; this.PrintLogMode = PrintLogMode; }
private void RunEvaluationDelegateTest(EvaluationDelegate evaluation) { var q1 = NewQuery(); var cq1 = q1; q1.Constrain(GetType()); cq1 = cq1.Descend("child"); cq1.Constrain(evaluation); var os = q1.Execute(); Assert.AreEqual(1, os.Count); var se = (CsEvaluationDelegate) os.Next(); Assert.AreEqual("two", se.name); }
public GeneticAlgorithm(int populationSize, int chromosomeLength, int numberOfGenerations, double crossoverRate, double mutationRate, EvaluationDelegate fitnessFunction, BoundPair[] genesDomain , int elitismFactor = 0, SelectionMode Selection = SelectionMode.RouletteWheel, bool PrintLogMode = false) { this.populationSize = populationSize; this.chromosomeLength = chromosomeLength; this.numberOfGenerations = numberOfGenerations; this.crossoverRate = crossoverRate; this.mutationRate = mutationRate; this.fitnessFunction = fitnessFunction; this.genesDomain = genesDomain; this.elitismFactor = elitismFactor; this.PrintLogMode = PrintLogMode; }
void RunEvaluationDelegateTest(EvaluationDelegate evaluation) { IQuery q1 = NewQuery(); IQuery cq1 = q1; q1.Constrain(GetType()); cq1 = cq1.Descend("child"); cq1.Constrain(evaluation); IObjectSet os = q1.Execute(); Assert.AreEqual(1, os.Count); CsEvaluationDelegate se = (CsEvaluationDelegate)os.Next(); Assert.AreEqual("two", se.name); }
static PythonEngine() { Evaluator = delegate(bool dirty, string script, IEnumerable<Binding> bindings) { if (dirty) { engine.ProcessCode(script); dirty = false; } return engine.Evaluate(PythonBindings.Bindings.Concat(bindings)); }; Drawing = delegate(FScheme.Value val, RenderDescription rd) { }; }
static PythonEngine() { Evaluator = delegate(bool dirty, string script, IEnumerable<KeyValuePair<string, dynamic>> bindings) { if (dirty) { Engine.ProcessCode(script); dirty = false; } return Engine.Evaluate(PythonBindings.Bindings.Concat(bindings)); }; Drawing = delegate { }; }
private void RunEvaluationDelegateTest(EvaluationDelegate evaluation) { var q1 = NewQuery(); var cq1 = q1; q1.Constrain(GetType()); cq1 = cq1.Descend("child"); cq1.Constrain(evaluation); var os = q1.Execute(); Assert.AreEqual(1, os.Count); var se = (CsEvaluationDelegate)os.Next(); Assert.AreEqual("two", se.name); }
static PythonEngine() { Evaluator = delegate(bool dirty, string script, IEnumerable <Binding> bindings) { if (dirty) { engine.ProcessCode(script); dirty = false; } return(engine.Evaluate(PythonBindings.Bindings.Concat(bindings))); }; Drawing = delegate(FScheme.Value val, RenderDescription rd) { }; }
static PythonEngine() { Evaluator = delegate(bool dirty, string script, IEnumerable <KeyValuePair <string, dynamic> > bindings) { if (dirty) { Engine.ProcessCode(script); dirty = false; } return(Engine.Evaluate(PythonBindings.Bindings.Concat(bindings))); }; Drawing = delegate { }; }
public OptionEvaluator(string optionName, EvaluationDelegate evaluationMethod, ExecutionDelegate executionMethod = null) { if (string.IsNullOrEmpty(optionName)) { throw new System.ArgumentNullException("'id' can't be null or empty"); } if (evaluationMethod == null) { throw new System.ArgumentNullException("'evaluationMethod' can't be null"); } Name = optionName; Evaluated = false; _evaluationMethod = evaluationMethod; _executionMethod = executionMethod; }
internal static void EvaluationEvaluate(Object a_evaluation, ICandidate a_candidate) { IEvaluation eval = a_evaluation as IEvaluation; if (eval != null) { eval.Evaluate(a_candidate); } else { // use starting _ for PascalCase conversion purposes EvaluationDelegate _ed = a_evaluation as EvaluationDelegate; if (_ed != null) { _ed(a_candidate); } } }
public void SetNameDelegate(EvaluationDelegate method) { _name_delegate = method; }
public EvaluationDelegateWrapper(EvaluationDelegate evaluation) : base(evaluation) { }
public void SetEvaluationCallback(EvaluationDelegate evaluationCallback) { _evaluate = evaluationCallback; }
public EventCondition(EvaluationDelegate evaluationDelegate, int subjectId) { this.evaluationDelegate = evaluationDelegate; SubjectId = subjectId; }
static PythonEngine() { Evaluator = delegate(bool dirty, string script, IEnumerable<Binding> bindings) { if (dirty) { engine.ProcessCode(script); dirty = false; } return engine.Evaluate(PythonBindings.Bindings.Concat(bindings)); }; }
public void SetAutoCompleteDelegate(EvaluationDelegate method) { _auto_complete_delegate = method; }
public void AddEvaluator(string optionName, EvaluationDelegate evaluationMethod, ExecutionDelegate executionMethod = null) { OptionEvaluator evaluator = new OptionEvaluator(optionName, evaluationMethod, executionMethod); OptionEvaluators.Add(evaluator); }
public void SetDescriptionDelegate(EvaluationDelegate method) { _description_deletage = method; }