org.vizzini.ai.geneticalgorithm
Interface IContext

All Known Implementing Classes:
AbstractContext, AntContext, DefaultContext

public interface IContext

Defines methods required by a context in a genetic algorithm. The context provides the environment surrounding the evaluation of a chromosome.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 void add(IFitnessCase fitnessCase)
          Add the given fitness case.
 IFitnessCase getCurrentFitnessCase()
          Return the current fitness case.
 int getCurrentFitnessCaseIndex()
          Return the index of the current fitness case.
 int getFitnessCaseCount()
          Return the fitness case count.
 Object getStateVariable(String name)
          Return the state variable with the given name.
 void incrementCurrentFitnessCase()
          Move to the next fitness case.
 void reset()
          Reset to the initial settings.
 void setStateVariable(String name, Object value)
          Set the state variable with the given name to the given value.
 

Method Detail

add

void add(IFitnessCase fitnessCase)
Add the given fitness case.

Parameters:
fitnessCase - Fitness case.
Since:
v0.3

getCurrentFitnessCase

IFitnessCase getCurrentFitnessCase()
Return the current fitness case.

Since:
v0.3

getCurrentFitnessCaseIndex

int getCurrentFitnessCaseIndex()
Return the index of the current fitness case.

Since:
v0.3

getFitnessCaseCount

int getFitnessCaseCount()
Return the fitness case count.

Since:
v0.3

getStateVariable

Object getStateVariable(String name)
Return the state variable with the given name.

Parameters:
name - State variable name.
Since:
v0.3

incrementCurrentFitnessCase

void incrementCurrentFitnessCase()
Move to the next fitness case. If the current case index is equal to the number of cases, reset to zero.

Since:
v0.3

reset

void reset()
Reset to the initial settings.

Since:
v0.3

setStateVariable

void setStateVariable(String name,
                      Object value)
Set the state variable with the given name to the given value.

Parameters:
name - State variable name.
value - State variable value.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02