net.sourceforge.cilib.entity
Class Harmony

java.lang.Object
  extended by net.sourceforge.cilib.entity.AbstractEntity
      extended by net.sourceforge.cilib.entity.Harmony
All Implemented Interfaces:
Serializable, Comparable<Entity>, CandidateSolution, Entity, Cloneable

public class Harmony
extends AbstractEntity

Entity definition for a Harmony.

See Also:
Serialized Form

Constructor Summary
Harmony()
           
Harmony(Harmony copy)
           
 
Method Summary
 void calculateFitness()
          Calculate the fitness of the Entity incrementing the number of fitness evaluations for the algorithm.
 void calculateFitness(boolean count)
          Calculate the fitness of the Entity.
 int compareTo(Entity o)
          
 boolean equals(Object object)
           It doesn;t make sense to compare the meta data of the entity.
 Harmony getClone()
          Make a clone of the Entity the exact semantics of the clone method will be defined by the classes that implements this interface.
 int getDimension()
          Returns the dimension of the Entity.
 int hashCode()
          
 void initialise(OptimisationProblem problem)
          Intialise the Entity to something meaningful and within the problem space.
 void reinitialise()
          Re-initialise the given Entity within the defined domain.
 
Methods inherited from class net.sourceforge.cilib.entity.AbstractEntity
getBestFitness, getCandidateSolution, getFitness, getFitnessCalculator, getId, getProperties, setCandidateSolution, setFitnessCalculator, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Harmony

public Harmony()

Harmony

public Harmony(Harmony copy)
Method Detail

getClone

public Harmony getClone()
Make a clone of the Entity the exact semantics of the clone method will be defined by the classes that implements this interface.

Returns:
the cloned object
See Also:
Object.clone()

equals

public boolean equals(Object object)
It doesn;t make sense to compare the meta data of the entity. In other words, the properties of the entity may vary, but the entity is still the same entity.

Overrides:
equals in class AbstractEntity
Parameters:
object - The object to compare.

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractEntity

calculateFitness

public void calculateFitness()
Calculate the fitness of the Entity incrementing the number of fitness evaluations for the algorithm.


calculateFitness

public void calculateFitness(boolean count)
Calculate the fitness of the Entity. This method may or may not increment the number of fitness evaluations of the algorithm.

Parameters:
count - Add or do not add this fitness evaluation to the algorithm global count.

compareTo

public int compareTo(Entity o)


getDimension

public int getDimension()
Returns the dimension of the Entity.

Returns:
The dimension of the Entity.

initialise

public void initialise(OptimisationProblem problem)
Intialise the Entity to something meaningful and within the problem space. The exact semantics of this method is defined by the classes that implements this interface. Take note. The Intialiser is obsolete the new Type System handles it now. Init can be left out now.

Parameters:
problem - The OptimisationProblem to based the initialisation on.

reinitialise

public void reinitialise()
Re-initialise the given Entity within the defined domain.



Copyright © 2009 CIRG. All Rights Reserved.