A Genetic Programming Framework for .NET

IIndividual Interface

Represents an Individual in Genetic Programming, as used by the GPEngine.

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

public interface IIndividual

Types that implement IIndividual

Type Description
AntIndividual Represents an ant in the GeneticProgrammingEngine.ProblemSpace.ArtificialAnt problem.
GapAntIndividual Represents an ant in the GeneticProgrammingEngine.ProblemSpace.ArtificialAnt problem.

Remarks

The IIndividual passed to the BaseClassVerifier is used as the Base Class for the IIndividuals generated by the framework.

In generated IIndividuals, the Test method is overridden with the code stored in the PrecodeTree property of its IndividualInfo.

Design Note

In this framework, implementations of IIndividual (also known as the Base Class) are responsible for a few generic test-related functions (defined in the interface), and for implementing problem-specific methods. These methods provide the operations available to derived Individuals and interact with the current Environment during a test. The framework has no knowledge about what these methods do, only that they are available to create new Individuals.

Chosen methods are stored in an IPrecodeTree in an IndividualInfo. When a Population is tested, the Precode for each Individual is converted to actual code, creating a new IIndividual derived from the Individual Base Class and overriding the Test method.

For example, in the case of the Artificial Ant problem, the Base Class would define methods like MoveForward, TurnLeft, TurnRight, and IsFoodAhead, which derived Individuals (ants, in this case) would combine into something like the following:

public override void Test() {
   if( IsFoodAhead() ) {
      MoveForward();
   }
   else {
      TurnLeft();
   }
}

Requirements

Namespace: GeneticProgrammingEngine.ProblemSpace

Assembly: GeneticProgrammingEngine (in GeneticProgrammingEngine.dll)

See Also

IIndividual Members | GeneticProgrammingEngine.ProblemSpace Namespace | Individual Term | IBaseClassVerifier Interface | IEnvironment Interface | IndividualInfo Class | PrecodeTree Property | Tester Class