/// <summary> /// Called before every test. /// </summary> protected override void InitializeDefault() { var configuration = this.GetDefaultAlgorithmTunerConfiguration(); var targetAlgorithmFactory = new ExtractIntegerValueCreator(); this.ParameterTree = GenomeAssistedSorterBaseTest <TSearchPoint> .CreateParameterTree(); this.ActorSystem = ActorSystem.Create(TestBase.ActorSystemName, configuration.AkkaConfiguration); var resultStorageActor = this.ActorSystem.ActorOf( Props.Create(() => new ResultStorageActor <TestInstance, IntegerResult>()), AkkaNames.ResultStorageActor); this.GenerationEvaluationActor = this.ActorSystem.ActorOf( Props.Create( () => new GenerationEvaluationActor <ExtractIntegerValue, TestInstance, IntegerResult>( targetAlgorithmFactory, this._runEvaluator, configuration, resultStorageActor, this.ParameterTree, null)), AkkaNames.GenerationEvaluationActor); this.GenomeBuilder = this.CreateGenomeBuilderWithForbiddenValue(configuration); this.InitializeSorter(this.GenerationEvaluationActor); // Ensure sorting data exists. this.GenomeAssistedSorter.UpdateInstances(new[] { new TestInstance("test") }); }
/// <summary> /// Called before every test. /// </summary> protected override void InitializeDefault() { var configuration = this.GetDefaultAlgorithmTunerConfiguration(); this.ParameterTree = GenomeAssistedSorterBaseTest <TSearchPoint> .CreateParameterTree(); this.ActorSystem = ActorSystem.Create(TestBase.ActorSystemName, configuration.AkkaConfiguration); this.GenomeSorter = this.ActorSystem.ActorOf( Props.Create(() => new GenomeSorter <TestInstance, IntegerResult>(this._runEvaluator)), AkkaNames.GenomeSorter); this.BuildUpRelatedActors(this.ActorSystem, configuration); this.GenomeBuilder = this.CreateGenomeBuilderWithForbiddenValue(configuration); this.InitializeSorter(this.GenomeSorter); // Ensure sorting data exists. this.GenomeAssistedSorter.UpdateInstances(new[] { new TestInstance("test") }); }