simbad.picoevo.core.representation
Class PopulationContainer

java.lang.Object
  extended by simbad.picoevo.core.representation.EvolutionObject
      extended by simbad.picoevo.core.representation.PopulationObject
          extended by simbad.picoevo.core.representation.PopulationContainer
All Implemented Interfaces:
PopulationInterface

public class PopulationContainer
extends PopulationObject
implements PopulationInterface

This class is used to manipulate set of individuals. This is a powerhunger since multiple copy operations of individual lists are performed to ensure registering single-referenced individuals. In practical, this is useful for educational purpose, but *not* for heavy evolution. In this latter case, one should better use the no-argument constructor and registerClonedIndividual method to manually register individual. Of course, beware of individuals with multiple registrations.

Author:
bredeche

Field Summary
 
Fields inherited from class simbad.picoevo.core.representation.PopulationObject
_individualList
 
Fields inherited from class simbad.picoevo.core.representation.EvolutionObject
_memoryModule, _name, _variationOperatorList
 
Constructor Summary
PopulationContainer()
           
PopulationContainer(java.util.ArrayList __individualList)
          warning : this method *clone* target individuals
PopulationContainer(PopulationView __populationView)
          warning : this method *clone* target individuals
PopulationContainer(java.lang.String __name)
           
PopulationContainer(java.lang.String __name, java.util.ArrayList __individualList)
           
PopulationContainer(java.lang.String __name, PopulationView __populationView)
           
 
Method Summary
 void cloneAndRegisterIndividual(Individual __individual)
          This method clone the given individual and add the clone to the container list.
 void mergeWithContainer(PopulationContainer __targetPopulationContainer)
          Add all individual in target container to the calling container's list of individuals (concatenate).
 void registerIndividual(Individual __individual)
          warning : this method *do not clone* the target individual but just *insert* it in a list (assume cloning has been done elsewhere).
 void registerListOfIndividuals(java.util.ArrayList __individualList)
          register **clones** of individuals in the list
 void registerListOfIndividuals(PopulationView __populationView)
          register **clones** of individuals in the PopulationView's list
 
Methods inherited from class simbad.picoevo.core.representation.PopulationObject
displayInformation, getIndividual, getIndividualList, getPopulationSize, performVariations, reset
 
Methods inherited from class simbad.picoevo.core.representation.EvolutionObject
addOperator, addOperatorList, getDisplayInformation, getName, getVariationOperator, getVariationOperatorList, getVariationOperatorListSize, performLevelVariations, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface simbad.picoevo.core.representation.PopulationInterface
getIndividual, getIndividualList, getPopulationSize, reset
 

Constructor Detail

PopulationContainer

public PopulationContainer(java.util.ArrayList __individualList)
warning : this method *clone* target individuals


PopulationContainer

public PopulationContainer(PopulationView __populationView)
warning : this method *clone* target individuals


PopulationContainer

public PopulationContainer(java.lang.String __name,
                           java.util.ArrayList __individualList)

PopulationContainer

public PopulationContainer(java.lang.String __name,
                           PopulationView __populationView)

PopulationContainer

public PopulationContainer(java.lang.String __name)

PopulationContainer

public PopulationContainer()
Method Detail

registerListOfIndividuals

public void registerListOfIndividuals(java.util.ArrayList __individualList)
register **clones** of individuals in the list


registerListOfIndividuals

public void registerListOfIndividuals(PopulationView __populationView)
register **clones** of individuals in the PopulationView's list


mergeWithContainer

public void mergeWithContainer(PopulationContainer __targetPopulationContainer)
Add all individual in target container to the calling container's list of individuals (concatenate). WARNING : target container is reseted! (i.e. individual list is set to null to ensure single referenced individuals)

Parameters:
__targetPopulationContainer -

registerIndividual

public void registerIndividual(Individual __individual)
warning : this method *do not clone* the target individual but just *insert* it in a list (assume cloning has been done elsewhere). It is important to note that only individuals that are **not** registered elsewhere should be added to a PopulationContainer. As a consequence, this method should be used rarely and/or wisely. In all other case, method registerCloneOfIndividual(.) can be used. use with extreme care. TODO auto-check if stand-alone clone

Specified by:
registerIndividual in interface PopulationInterface
Specified by:
registerIndividual in class PopulationObject

cloneAndRegisterIndividual

public void cloneAndRegisterIndividual(Individual __individual)
This method clone the given individual and add the clone to the container list. Warning, Albeit method name is similar to that of Population, implementation differ (**clone** of individual is inserted in the list)