Grouping Algorithm

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Grouping Algorithm

Gorek
Hi

I try to implement some kind of grouping algorithm in JGAP.
I create sample chromosome like above:

    private IChromosome createSampleCromosome() throws InvalidConfigurationException {
        Gene[] sampleGenes=new IntegerGene[chromosomeSize];
        for(int i=0;i<sampleGenes.length;i++)
            sampleGenes[i]=new IntegerGene(conf, 1, groups);
        return new Chromosome(conf, sampleGenes );
    }

If ith gene value is k means that ith object is classified to group k.

Chromosome is feasible if every group involve one or more objects.
Example:
We have 4 groups.
Chromosome 1 3 4 2 1 2 2 2 4  is correct(feasible)
Chromosome 1 3 2 2 1 2 2 2 3 isn't correct because not involve group '4'.

I create my population using:
population=Genotype.randomInitialGenotype(conf);

Is it possible to check chromosome feasibility before adding it to population or manual create every chromosome?
How can I do this?

Mariusz
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Loading...