ECF - Tutorial (v 1.0)


  1. In short - an overview (below)
  2. Minimal examples – by genotype (or “I don't care about evolutionary algorithms, I just want to solve my problem”)
  3. Customizing the Tree genotype (or “Where's GP? I want genetic programming”)
  4. Using the parameters (or “Hm, it doesn't work that well, can I make it any better”)
  5. Adding components to ECF (or “I know EC, I just want to use my special genotype/algorithm/whatever, how do I do it”)
  6. Using parallel ECF (or "Can it go any faster")

In short...

To use ECF, you can combine/parametrize the following components:

The above components are fully configurable without compilation via configuration file. The only element you need to program and define programmatically is the evaluation operator which embodies the fitness function. Once you write the evaluation operator, you only need to reference it in main and then run the ECF. So the typical main function might look like this:

int main(int argc, char **argv)
{
        StateP state = static_cast<StateP> (new State);
        state->setEvalOp(static_cast<EvaluateOpP> (new MyEvalOperator));

        state->initialize(argc, argv);
        state->run();
        return 0;
}

while the configuration file might look like this:

<ECF>
  <Algorithm>
    <SteadyStateTournament>
      <Entry key="tsize">3</Entry>
    </SteadyStateTournament>
  </Algorithm>

  <Genotype>
    <BitString>
      <Entry key="size">20</Entry>
    </BitString>
    <Tree>
      <Entry key="functionset">sin cos + - / *</Entry>
      <Entry key="terminalset">X Y</Entry>
    </Tree>
  </Genotype>

  <Registry>
    <Entry key="population.size">30</Entry>
    <Entry key="term.maxgen">100</Entry> 
  </Registry>
</ECF>

Implementation note: each Class in ECF has an associated type ClassP which is a boost smart pointer to an object of that class.
See more information on using boost.