/// <summary> /// (Re-)Initializes the instance with the specified evaluation. /// </summary> /// <param name="evaluation">The evaluation message.</param> /// <param name="instancesForEvaluation">The instances for evaluation.</param> public void Initialize(GenomeEvaluation evaluation, List <TInstance> instancesForEvaluation) { this._currentEvaluationId = evaluation.EvaluationId; this._openInstances.Clear(); this._openInstances.AddRange(instancesForEvaluation); }
/// <summary> /// Actor has accepted a <see cref="GenomeEvaluation" /> and migrates to the <see cref="ReadingFromStorage" /> /// state. /// </summary> /// <param name="evaluation">The accepted <see cref="GenomeEvaluation" />.</param> private void BecomeReadingFromStorage(GenomeEvaluation evaluation) { // Configure target algorithm. this._currentGenome = evaluation.Genome; this._configuredTargetAlgorithm = this._targetAlgorithmFactory.ConfigureTargetAlgorithm( this._currentGenome.GetFilteredGenes(this._parameterTree)); // Initialize evaluation progress this._currentEvaluationProgress.Initialize(evaluation, this._instancesForEvaluation); // Change state to reading from storage. this.Become(this.ReadingFromStorage); // Start working. this.WorkOnNextInstance(); }
/// <summary> /// Prepares <paramref name="evaluator"/> for the evaluation <paramref name="nextGenomeEvaluation"/>. /// </summary> /// <param name="evaluator">The actor who will evaluate the <see cref="Genome"/>.</param> /// <param name="nextGenomeEvaluation">The <see cref="GenomeEvaluation"/>.</param> protected override void PrepareForEvaluation(IActorRef evaluator, GenomeEvaluation nextGenomeEvaluation) { Context.Watch(evaluator); base.PrepareForEvaluation(evaluator, nextGenomeEvaluation); }
/// <summary> /// Initializes a new instance of the <see cref="GenomeEvaluationTest"/> class. /// </summary> public GenomeEvaluationTest() { this._genome = new ImmutableGenome(new Genome()); this._genomeEvaluation = new GenomeEvaluation(this._genome, this._evaluationId); }
/// <summary> /// Prepares <paramref name="evaluator"/> for the evaluation <paramref name="nextGenomeEvaluation"/>. /// </summary> /// <param name="evaluator">The actor who will evaluate the <see cref="Genome"/>.</param> /// <param name="nextGenomeEvaluation">The <see cref="GenomeEvaluation"/>.</param> protected virtual void PrepareForEvaluation(IActorRef evaluator, GenomeEvaluation nextGenomeEvaluation) { }