net.sourceforge.cilib.bioinf.rnaprediction
Class RNAParticle

java.lang.Object
  extended by net.sourceforge.cilib.entity.AbstractEntity
      extended by net.sourceforge.cilib.pso.particle.AbstractParticle
          extended by net.sourceforge.cilib.bioinf.rnaprediction.RNAParticle
All Implemented Interfaces:
Serializable, Comparable<Entity>, CandidateSolution, Entity, Particle, SocialEntity, Cloneable

public class RNAParticle
extends AbstractParticle

Author:
marais
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.pso.particle.AbstractParticle
neighbourhoodBestUpdateStrategy, personalBestUpdateStrategy, positionInitialisationStrategy, positionUpdateStrategy, velocityInitialisationStrategy, velocityUpdateStrategy
 
Constructor Summary
RNAParticle()
          Create a new RNAParticle instance.
RNAParticle(RNAParticle copy)
          Copy constructor.
 
Method Summary
 void calculateFitness(boolean count)
          Calculate the fitness of the Entity.
 boolean equals(Object object)
           It doesn;t make sense to compare the meta data of the entity.
 Fitness getBestFitness()
          Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity.
 StructuredType getBestPosition()
          Get the best position of the Particle.
 RNAParticle 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.
 RNAFitness getFitnessCalc()
           
 Particle getNeighbourhoodBest()
          Get the current Particle's neighbourhood best.
 StructuredType getPosition()
          Get the position of the Particle.
 StructuredType getVelocity()
          Get the velocity representation of the Particle.
 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.
 void setBestPosition(Type bestPosition)
          Set the best position for the current RNAParticle.
 void setFitness(Fitness fitness)
          Explicitly set the current fitness value.
 void setFitnessCalc(RNAFitness fitnessCalc)
           
 void setNeighbourhoodBest(Particle particle)
          Set the neighbourhood best particle for the current Particle based on the topology of the current particle.
 void setRNAFolder(RNAFolder folder)
          Set the RNAFolder to use.
 void updateControlParameters()
          Update all the ControlParameters that are maintained within the Particle.
 void updatePosition()
          Update the position of the Particle.
 void updateVelocity()
          Update the velocity of the Particle.
 
Methods inherited from class net.sourceforge.cilib.pso.particle.AbstractParticle
calculateFitness, compareTo, getNeighbourhoodBestUpdateStrategy, getPersonalBestUpdateStrategy, getPositionInitialisationStrategy, getPositionUpdateStrategy, getSocialBestFitness, getVelocityInitialisationStrategy, getVelocityUpdateStrategy, setNeighbourhoodBestUpdateStrategy, setPersonalBestUpdateStrategy, setPositionInitialisationStrategy, setPositionUpdateStrategy, setVelocityInitialisationStrategy, setVelocityUpdateStrategy
 
Methods inherited from class net.sourceforge.cilib.entity.AbstractEntity
getCandidateSolution, getFitness, getFitnessCalculator, getId, getProperties, setCandidateSolution, setFitnessCalculator, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.cilib.entity.Particle
getFitness
 
Methods inherited from interface net.sourceforge.cilib.entity.Entity
getCandidateSolution, getFitnessCalculator, getId, getProperties, setCandidateSolution, setProperties
 

Constructor Detail

RNAParticle

public RNAParticle()
Create a new RNAParticle instance.


RNAParticle

public RNAParticle(RNAParticle copy)
Copy constructor. Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

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

Specified by:
getClone in interface Entity
Specified by:
getClone in interface Particle
Specified by:
getClone in interface Cloneable
Specified by:
getClone in class AbstractParticle
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 AbstractParticle
Parameters:
object - The object to compare equality.

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractParticle

setFitness

public void setFitness(Fitness fitness)
Explicitly set the current fitness value.

Parameters:
fitness - The Fitness to set.

getBestFitness

public Fitness getBestFitness()
Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity. If a best fitness is not defined, the current fitness is returned as it is the best current fitness. Entity objects that need to use this method need to override it in their implementation, for example with Particle objects.

Specified by:
getBestFitness in interface Entity
Specified by:
getBestFitness in interface Particle
Specified by:
getBestFitness in class AbstractParticle
Returns:
The associated best Fitness value.

getDimension

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

Specified by:
getDimension in interface Entity
Specified by:
getDimension in interface Particle
Specified by:
getDimension in class AbstractParticle
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.

getPosition

public StructuredType getPosition()
Get the position of the Particle.

Specified by:
getPosition in interface Particle
Specified by:
getPosition in class AbstractParticle
Returns:
A Type representing the Particle's position.

getBestPosition

public StructuredType getBestPosition()
Get the best position of the Particle.

Specified by:
getBestPosition in interface Particle
Specified by:
getBestPosition in class AbstractParticle
Returns:
A Type representng the Particle's best position.

setBestPosition

public void setBestPosition(Type bestPosition)
Set the best position for the current RNAParticle.

Parameters:
bestPosition - The best position to be set.

getVelocity

public StructuredType getVelocity()
Get the velocity representation of the Particle.

Specified by:
getVelocity in interface Particle
Specified by:
getVelocity in class AbstractParticle
Returns:
A Type representing the Particle's velocity.

setNeighbourhoodBest

public void setNeighbourhoodBest(Particle particle)
Set the neighbourhood best particle for the current Particle based on the topology of the current particle.

Specified by:
setNeighbourhoodBest in interface Particle
Specified by:
setNeighbourhoodBest in class AbstractParticle
Parameters:
particle - The particle to use as the current particle's neighhod best particle

getNeighbourhoodBest

public Particle getNeighbourhoodBest()
Get the current Particle's neighbourhood best.

Specified by:
getNeighbourhoodBest in interface Particle
Specified by:
getNeighbourhoodBest in class AbstractParticle
Returns:
The neighbourhood best of the Particle

updatePosition

public void updatePosition()
Update the position of the Particle.

Specified by:
updatePosition in interface Particle
Specified by:
updatePosition in class AbstractParticle

updateVelocity

public void updateVelocity()
Update the velocity of the Particle.

Specified by:
updateVelocity in interface Particle
Specified by:
updateVelocity in class AbstractParticle

updateControlParameters

public void updateControlParameters()
Update all the ControlParameters that are maintained within the Particle.

Specified by:
updateControlParameters in interface Particle
Specified by:
updateControlParameters in class AbstractParticle

setRNAFolder

public void setRNAFolder(RNAFolder folder)
Set the RNAFolder to use.

Parameters:
folder - The RNAFolder to be used by the current RNAParticle.

setFitnessCalc

public void setFitnessCalc(RNAFitness fitnessCalc)
Parameters:
fitnessCalc - The fitnessCalc to set.

getFitnessCalc

public RNAFitness getFitnessCalc()
Returns:
Returns the fitnessCalc.

reinitialise

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


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.

Specified by:
calculateFitness in interface Entity
Specified by:
calculateFitness in class AbstractParticle
Parameters:
count - Add or do not add this fitness evaluation to the algorithm global count.


Copyright © 2009 CIRG. All Rights Reserved.