Java Doc for Population.java in  » Development » jgap » org » jgap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jgap » org.jgap 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgap.Population

Population
public class Population implements Serializable,ICloneable,IPersistentRepresentation(Code)
List of chromosomes held in the Genotype (or possibly later in the Configuration object).
author:
   Klaus Meffert
since:
   2.0


Field Summary
final public static  StringCHROM_DELIMITER
    
final public static  StringCHROM_DELIMITER_CLOSING
     Represents the closing delimiter that is used to separate chromosomes in the persistent representation.
final public static  StringCHROM_DELIMITER_HEADING
     Represents the heading delimiter that is used to separate chromosomes in the persistent representation.

Constructor Summary
public  Population(Configuration a_config)
    
public  Population(Configuration a_config, IChromosome[] a_chromosomes)
    
public  Population(Configuration a_config, IChromosome a_chromosome)
    
public  Population(Configuration a_config, int a_size)
    
public  Population()
    

Method Summary
public  voidaddChromosome(IChromosome a_toAdd)
     Adds a Chromosome to this Population.
public  voidaddChromosomes(Population a_population)
     Adds all the Chromosomes in the given Population.
public  voidclear()
     Clears the list of chromosomes.
public  Objectclone()
    
public  intcompareTo(Object a_pop)
     This method is not producing symmetric results as -1 is more often returned than 1 (see description of return value).
Parameters:
  a_pop - the other population to compare 1: a_pop is null or having fewer chromosomes or equal numberof chromosomes but at least one not contained.
public  booleancontains(IChromosome a_chromosome)
     Determines whether the given chromosome is contained within the population.
protected  IChromosomecreateChromosome(String a_chromClassName, String a_persistentRepresentation)
     Creates a new Chromosome instance.

Taken and adapted from CompositeGene.

public  IChromosomedetermineFittestChromosome()
     Determines the fittest Chromosome in the Population (the one with the highest fitness value) and memorizes it.
public  IChromosomedetermineFittestChromosome(int a_startIndex, int a_endIndex)
     Determines the fittest Chromosome in the population (the one with the highest fitness value) within the given indices and memorizes it.
public  ListdetermineFittestChromosomes(int a_numberOfChromosomes)
     Sorts the Chromosome list and returns the fittest n Chromosomes in the population.
public  booleanequals(Object a_pop)
     The equals-method.
public  IChromosomegetChromosome(int a_index)
    
public  ListgetChromosomes()
     the list of Chromosome's in the Population.
public  ConfigurationgetConfiguration()
    
public  ListgetGenome(boolean a_resolveCompositeGenes)
     Returns the genotype of the population, i.e.
public  StringgetPersistentRepresentation()
     Returns a persistent representation of this chromosome, see interface Gene for description.
public  booleanisChanged()
    
public  booleanisSorted()
    
public  Iteratoriterator()
     Iterator for the Chromosome list in the Population.
public  voidkeepPopSizeConstant()
     Cares that the population size does not exceed the maximum size given in the configuration.
 IChromosomeremoveChromosome(int a_index)
     Removes a chromosome in the list at the given index.
protected  voidsetChanged(boolean a_changed)
     Mark that for the population the fittest chromosome may have changed.
public  voidsetChromosome(int a_index, IChromosome a_chromosome)
     Sets in the given Chromosome on the given index in the list of chromosomes.
public  voidsetChromosomes(List a_chromosomes)
     Replaces all chromosomes in the population with the give list of chromosomes.
protected  voidsetSorted(boolean a_sorted)
     Mark the population as sorted.
public  voidsetValueFromPersistentRepresentation(String a_representation)
     Counterpart of getPersistentRepresentation.
public  intsize()
    
protected  voidsort(Comparator a_comparator)
     Sorts the chromosomes within the population utilzing the given comparator.
public  voidsortByFitness()
     Sorts the chromosomes within the population according to their fitness value using ChromosomFitnessComparator.
final protected static  Listsplit(String a_string)
     Splits the input a_string into individual chromosome representations.

Taken and adapted from CompositeGene.

public  IChromosome[]toChromosomes()
    

Field Detail
CHROM_DELIMITER
final public static String CHROM_DELIMITER(Code)



CHROM_DELIMITER_CLOSING
final public static String CHROM_DELIMITER_CLOSING(Code)
Represents the closing delimiter that is used to separate chromosomes in the persistent representation.



CHROM_DELIMITER_HEADING
final public static String CHROM_DELIMITER_HEADING(Code)
Represents the heading delimiter that is used to separate chromosomes in the persistent representation.




Constructor Detail
Population
public Population(Configuration a_config) throws InvalidConfigurationException(Code)



Population
public Population(Configuration a_config, IChromosome[] a_chromosomes) throws InvalidConfigurationException(Code)



Population
public Population(Configuration a_config, IChromosome a_chromosome) throws InvalidConfigurationException(Code)



Population
public Population(Configuration a_config, int a_size) throws InvalidConfigurationException(Code)



Population
public Population() throws InvalidConfigurationException(Code)




Method Detail
addChromosome
public void addChromosome(IChromosome a_toAdd)(Code)
Adds a Chromosome to this Population. Does nothing when given null.
Parameters:
  a_toAdd - the Chromosome to add
author:
   Klaus Meffert
since:
   2.0



addChromosomes
public void addChromosomes(Population a_population)(Code)
Adds all the Chromosomes in the given Population. Does nothing on null or an empty Population.
Parameters:
  a_population - the Population to add
author:
   Klaus Meffert
since:
   2.0



clear
public void clear()(Code)
Clears the list of chromosomes. Normally, this should not be necessary. But especially in distributed computing, a fresh population has to be provided sometimes.
author:
   Klaus Meffert
since:
   3.2



clone
public Object clone()(Code)
deeply cloned population instance
author:
   Klaus Meffert
since:
   3.2



compareTo
public int compareTo(Object a_pop)(Code)
This method is not producing symmetric results as -1 is more often returned than 1 (see description of return value).
Parameters:
  a_pop - the other population to compare 1: a_pop is null or having fewer chromosomes or equal numberof chromosomes but at least one not contained. 0: both populationscontaining exactly the same chromosomes. -1: this population contains fewerchromosomes than a_pop
author:
   Klaus Meffert
since:
   2.6



contains
public boolean contains(IChromosome a_chromosome)(Code)
Determines whether the given chromosome is contained within the population.
Parameters:
  a_chromosome - the chromosome to check true: chromosome contained within population
author:
   Klaus Meffert
since:
   2.1



createChromosome
protected IChromosome createChromosome(String a_chromClassName, String a_persistentRepresentation) throws Exception(Code)
Creates a new Chromosome instance.

Taken and adapted from CompositeGene.
Parameters:
  a_chromClassName - name of the Chromosome class
Parameters:
  a_persistentRepresentation - persistent representation of theChromosome to create (could be obtained via getPersistentRepresentation) newly created Chromosome
throws:
  Exception -
author:
   Klaus Meffert
since:
   3.2




determineFittestChromosome
public IChromosome determineFittestChromosome()(Code)
Determines the fittest Chromosome in the Population (the one with the highest fitness value) and memorizes it. This is an optimized version compared to calling determineFittesChromosomes(1). the fittest Chromosome of the Population
author:
   Klaus Meffert
since:
   2.0



determineFittestChromosome
public IChromosome determineFittestChromosome(int a_startIndex, int a_endIndex)(Code)
Determines the fittest Chromosome in the population (the one with the highest fitness value) within the given indices and memorizes it. This is an optimized version compared to calling determineFittesChromosomes(1).
Parameters:
  a_startIndex - index to begin the evaluation with
Parameters:
  a_endIndex - index to end the evaluation with the fittest Chromosome of the population within the given indices
author:
   Klaus Meffert
since:
   3.0



determineFittestChromosomes
public List determineFittestChromosomes(int a_numberOfChromosomes)(Code)
Sorts the Chromosome list and returns the fittest n Chromosomes in the population.
Parameters:
  a_numberOfChromosomes - number of top performer chromosomes to bereturned list of the fittest n Chromosomes of the population, or the fittestx Chromosomes with x = number of chromosomes in case n > x.
author:
   Charles Kevin Hill
since:
   2.4



equals
public boolean equals(Object a_pop)(Code)
The equals-method.
Parameters:
  a_pop - the population instance to compare with true: given object equal to comparing one
author:
   Klaus Meffert
since:
   2.6



getChromosome
public IChromosome getChromosome(int a_index)(Code)

Parameters:
  a_index - the index of the Chromosome to be returned Chromosome at given index in the Population
author:
   Klaus Meffert
since:
   2.0



getChromosomes
public List getChromosomes()(Code)
the list of Chromosome's in the Population. Don't modify theretrieved list by using clear(), remove(int) etc. If you do so, you need tocall setChanged(true)
author:
   Klaus Meffert
since:
   2.0



getConfiguration
public Configuration getConfiguration()(Code)



getGenome
public List getGenome(boolean a_resolveCompositeGenes)(Code)
Returns the genotype of the population, i.e. the list of genes in the Population.
Parameters:
  a_resolveCompositeGenes - true: split encountered CompositeGenesinto their single (atomic) genes genotype of the population
author:
   Klaus Meffert
since:
   2.3



getPersistentRepresentation
public String getPersistentRepresentation()(Code)
Returns a persistent representation of this chromosome, see interface Gene for description. Similar to CompositeGene's routine. But does not include all information of the chromosome (yet). string representation of this Chromosome's relevant parts of itscurrent state
throws:
  UnsupportedOperationException -
author:
   Klaus Meffert
since:
   3.2



isChanged
public boolean isChanged()(Code)
true: population's chromosomes (maybe) were changed,false: not changed for sure
since:
   2.6



isSorted
public boolean isSorted()(Code)



iterator
public Iterator iterator()(Code)
Iterator for the Chromosome list in the Population. Please be awarethat using remove() forces you to call setChanged(true)
author:
   Klaus Meffert
since:
   2.0



keepPopSizeConstant
public void keepPopSizeConstant() throws InvalidConfigurationException(Code)
Cares that the population size does not exceed the maximum size given in the configuration.
throws:
  InvalidConfigurationException -
author:
   Klaus Meffert
since:
   3.2



removeChromosome
IChromosome removeChromosome(int a_index)(Code)
Removes a chromosome in the list at the given index. Method has package visibility to signal that this is a method not to be used outside the JGAP kernel under normal circumstances.
Parameters:
  a_index - index of chromosome to be removed in list removed Chromosome
author:
   Klaus Meffert
since:
   2.4



setChanged
protected void setChanged(boolean a_changed)(Code)
Mark that for the population the fittest chromosome may have changed.
Parameters:
  a_changed - true: population's fittest chromosome may have changed,false: fittest chromosome evaluated earlier is still valid
author:
   Klaus Meffert
since:
   2.2



setChromosome
public void setChromosome(int a_index, IChromosome a_chromosome)(Code)
Sets in the given Chromosome on the given index in the list of chromosomes. If the given index is exceeding the list by one, the chromosome is appended.
Parameters:
  a_index - the index to set the Chromosome in
Parameters:
  a_chromosome - the Chromosome to be set
author:
   Klaus Meffert
since:
   2.0



setChromosomes
public void setChromosomes(List a_chromosomes)(Code)
Replaces all chromosomes in the population with the give list of chromosomes.
Parameters:
  a_chromosomes - the chromosomes to make the population up from
author:
   Klaus Meffert



setSorted
protected void setSorted(boolean a_sorted)(Code)
Mark the population as sorted.
Parameters:
  a_sorted - true: mark population as sorted
author:
   Klaus Meffert
since:
   2.6



setValueFromPersistentRepresentation
public void setValueFromPersistentRepresentation(String a_representation) throws UnsupportedRepresentationException(Code)
Counterpart of getPersistentRepresentation.
Parameters:
  a_representation - the string representation retrieved from a priorcall to the getPersistentRepresentation() method
throws:
  UnsupportedRepresentationException -
author:
   Klaus Meffert
since:
   3.2



size
public int size()(Code)
number of Chromosome's in the Population
author:
   Klaus Meffert
since:
   2.0



sort
protected void sort(Comparator a_comparator)(Code)
Sorts the chromosomes within the population utilzing the given comparator.
Parameters:
  a_comparator - the comparator to utilize for sorting
author:
   Klaus Meffert
since:
   2.6



sortByFitness
public void sortByFitness()(Code)
Sorts the chromosomes within the population according to their fitness value using ChromosomFitnessComparator. The fittest chromosome is then at index 0.
author:
   Klaus Meffert
since:
   2.6



split
final protected static List split(String a_string) throws UnsupportedRepresentationException(Code)
Splits the input a_string into individual chromosome representations.

Taken and adapted from CompositeGene.
Parameters:
  a_string - the string to split the elements of the returned array are the persistentrepresentation strings of the population's components
throws:
  UnsupportedRepresentationException -
author:
   Klaus Meffert
since:
   3.2




toChromosomes
public IChromosome[] toChromosomes()(Code)
the Population converted into a list of Chromosome's
author:
   Klaus Meffert, Dan Clark
since:
   2.0



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.