A Genetic Programming Framework for .NET

Tester Class

Compiles and tests a Population.

For a list of all members of this type, see Tester Members.

System.Object
   GeneticProgrammingEngine.Internal.Tester

public class Tester

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The Tester is responsible for compiling the code file for a Population, instantiating each IIndividual, and testing them in the given IEnvironments. This is accomplished by the CompileAndTest method. The results of these tests are saved to a new GenerationHistory.

The Tester is instantiated in a separate AppDomain by the GPEngine so that the generated Assembly can be unloaded when testing is finished.

Design Note

As mentioned in the Remarks section above, the primary reason for placing the test code in its own class was to instantiate that class in a separate AppDomain. This alleviates a memory leak found in earlier designs where compiled Assembly instances continued to reside in memory long after they had been discarded.

As an added benefit, this design also segregates the relatively complicated code responsible for testing IIndividuals into an entirely separate space from the broader Genetic Programming Algorithm.

The Tester class has static and instance versions of its CompileAndTest method to allow for calls in separate AppDomains. The instance version uses properties set in the constructor of changed afterward to call the static implementation.

Requirements

Namespace: GeneticProgrammingEngine.Internal

Assembly: GeneticProgrammingEngine (in GeneticProgrammingEngine.dll)

See Also

Tester Members | GeneticProgrammingEngine.Internal Namespace | test Term | CompileAndTest Method