Chromosome constructor, and jgap GUI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Chromosome constructor, and jgap GUI

manolakis
Hi there

I am looking in the jgap api the following Chromosome contructor
Chromosome(Configuration a_configuration, Gene[] a_initialGenes)
, and I was wondering if there would be any problem if the Genes array[] contain different types of jgap Genes classes. For instance some of them are IntegerGene, DoubleGene, BooleanGene. Is it possible to construct an array of Genes with different types of Genes? I would also be obliged to anyone that can help me to work with jgap's GUI. I have seen that it is possible to visualize a solution. I had tried to find any examples in the package but didn't make it. Any recommendation?

Thanks for your time
Reply | Threaded
Open this post in threaded view
|

Re: Chromosome constructor, and jgap GUI

Klaus Meffert-5
Manolakis,

In Java it is no problem constructing an array with different Gene types as
Gene is the interface and IntegerGene etc. is the implementation of the Gene
interface. Just write :

Gene[] sampleGenes = new Gene[3];
sampleGenes[0] = new IntegerGene(...);
sampleGenes[0] = new DoubleGene(...);
...

About visualizing results: See for example class
MinimizingMakeChangeWithChart (GA) or Fibonacci (GP).

Best

Klaus

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of manolakis
> Sent: Sunday, November 04, 2007 2:03 AM
> To: [hidden email]
> Subject: [jgap-users] Chromosome constructor, and jgap GUI
>
>
> Hi there
>
> I am looking in the jgap api the following Chromosome
> contructor Chromosome(Configuration a_configuration, Gene[]
> a_initialGenes) , and I was wondering if there would be any
> problem if the Genes array[] contain different types of jgap
> Genes classes. For instance some of them are IntegerGene,
> DoubleGene, BooleanGene. Is it possible to construct an array
> of Genes with different types of Genes? I would also be
> obliged to anyone that can help me to work with jgap's GUI. I
> have seen that it is possible to visualize a solution. I had
> tried to find any examples in the package but didn't make it.
> Any recommendation?
>
> Thanks for your time
> --


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users