ec.app.sum
Class Sum

java.lang.Object
  extended by ec.Problem
      extended by ec.app.sum.Sum
All Implemented Interfaces:
Prototype, Setup, SimpleProblemForm, java.io.Serializable, java.lang.Cloneable

public class Sum
extends Problem
implements SimpleProblemForm

Sum is a simple example of the ec.Vector package, implementing the very simple sum problem (fitness = sum over vector). This is a generalization of the common MaxOnes problem (fitness = number of 1's in vector).

Version:
1.0
Author:
Sean Luke
See Also:
Serialized Form

Field Summary
static java.lang.String P_SUM
           
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
Sum()
           
 
Method Summary
 Parameter defaultBase()
          Here's a nice default base for you -- you can change it if you like
 void describe(Individual ind, EvolutionState state, int threadnum, int log, int verbosity)
           
 void evaluate(EvolutionState state, Individual ind, int subpop, int threadnum)
          Evaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.
 
Methods inherited from class ec.Problem
canEvaluate, clone, closeContacts, describe, evaluate, finishEvaluating, getBase, initializeContacts, prepareToEvaluate, reinitializeContacts, setBase, setup
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ec.simple.SimpleProblemForm
canEvaluate, describe, evaluate
 

Field Detail

P_SUM

public static final java.lang.String P_SUM
See Also:
Constant Field Values
Constructor Detail

Sum

public Sum()
Method Detail

defaultBase

public Parameter defaultBase()
Description copied from class: Problem
Here's a nice default base for you -- you can change it if you like

Specified by:
defaultBase in interface Prototype
Overrides:
defaultBase in class Problem

evaluate

public void evaluate(EvolutionState state,
                     Individual ind,
                     int subpop,
                     int threadnum)
Description copied from interface: SimpleProblemForm
Evaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.

Specified by:
evaluate in interface SimpleProblemForm
Overrides:
evaluate in class Problem

describe

public void describe(Individual ind,
                     EvolutionState state,
                     int threadnum,
                     int log,
                     int verbosity)
Specified by:
describe in interface SimpleProblemForm
Overrides:
describe in class Problem