net.sourceforge.cilib.algorithm.initialisation
Class ClonedPopulationInitialisationStrategy

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.initialisation.PopulationInitialisationStrategy
      extended by net.sourceforge.cilib.algorithm.initialisation.ClonedPopulationInitialisationStrategy
All Implemented Interfaces:
Serializable, Cloneable

public class ClonedPopulationInitialisationStrategy
extends PopulationInitialisationStrategy

Create a collection of entities by cloning the given prototype Entity.

Author:
Gary Pampara
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.algorithm.initialisation.PopulationInitialisationStrategy
entityNumber
 
Constructor Summary
ClonedPopulationInitialisationStrategy()
          Create an instance of the ClonedPopulationInitialisationStrategy.
ClonedPopulationInitialisationStrategy(ClonedPopulationInitialisationStrategy copy)
          Copy constructor.
 
Method Summary
 ClonedPopulationInitialisationStrategy getClone()
          Create a cloned copy of the current object and return it.
 Entity getEntityType()
          Get the entity that has been defined as the prototype to for the copies.
 void initialise(Topology topology, OptimisationProblem problem)
          Perform the required initialisation, using the provided Topology and Problem.
 void setEntityType(Entity entityType)
          Set the prototype entity for the copy process.
 
Methods inherited from class net.sourceforge.cilib.algorithm.initialisation.PopulationInitialisationStrategy
getEntityNumber, setEntityNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClonedPopulationInitialisationStrategy

public ClonedPopulationInitialisationStrategy()
Create an instance of the ClonedPopulationInitialisationStrategy.


ClonedPopulationInitialisationStrategy

public ClonedPopulationInitialisationStrategy(ClonedPopulationInitialisationStrategy copy)
Copy constructor. Create a copy of the given instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public ClonedPopulationInitialisationStrategy getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Specified by:
getClone in class PopulationInitialisationStrategy
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

initialise

public void initialise(Topology topology,
                       OptimisationProblem problem)
Perform the required initialisation, using the provided Topology and Problem.

Specified by:
initialise in class PopulationInitialisationStrategy
Parameters:
topology - The given Topology to use in initialisation.
problem - The Problem to use in the initialisation of the topology.
Throws:
InitialisationException - if the initialisation cannot take place.

setEntityType

public void setEntityType(Entity entityType)
Set the prototype entity for the copy process.

Specified by:
setEntityType in class PopulationInitialisationStrategy
Parameters:
entityType - The Entity to use for the cloning process.

getEntityType

public Entity getEntityType()
Get the entity that has been defined as the prototype to for the copies.

Specified by:
getEntityType in class PopulationInitialisationStrategy
Returns:
The prototype Entity.
See Also:
ClonedPopulationInitialisationStrategy#getPrototypeEntity()


Copyright © 2009 CIRG. All Rights Reserved.