custom Gene/Chromosome creation

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

custom Gene/Chromosome creation

Aziz Yasri-2

Hello,

 

I am new to JGAP library usage. I just wanted to create new Gene that can use alleles from a defined set of alleles, let’s say from this list [1,2,3,10,20,30,78]. I cannot use new IntegerGene method since it fill the Gene by integers values between two values (lower-value and upper-value).

 

I just want to create chromosomes like these ones where the allelles are taken from the list  [1,2,3,10,20,30,78]:

Ch1: 1 2 20

Ch2: 20 30 78

Ch3: 2 10 1

 

Any sample code that perform this custom gene creation.

 

 

Best regards

Aziz



------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Mauricio Noda
You can try using the standard IntegerGene, with range from 1 to 7, and do a conversion inside your fitness function.
 
1 –> 1
2 –> 2
3 –> 3
4 –> 10
5 –> 20
6 –> 30
7 –> 78
 
You can also try creating a custom gene, which will probably be an IntegerGene with that same conversion embedded in it.
 
Sent: Wednesday, April 03, 2013 10:55 AM
Subject: [jgap-users] custom Gene/Chromosome creation
 

Hello,

 

I am new to JGAP library usage. I just wanted to create new Gene that can use alleles from a defined set of alleles, let’s say from this list [1,2,3,10,20,30,78]. I cannot use new IntegerGene method since it fill the Gene by integers values between two values (lower-value and upper-value).

 

I just want to create chromosomes like these ones where the allelles are taken from the list [1,2,3,10,20,30,78]:

Ch1: 1 2 20

Ch2: 20 30 78

Ch3: 2 10 1

 

Any sample code that perform this custom gene creation.

 

 

Best regards

Aziz



------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html


_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Giuseppe Quartarone
In reply to this post by Aziz Yasri-2
Hi Aziz
I'm new too, but I want to try to give my suggestion, maybe it might
be useful for you.
Well, if the the set of alleles values is the same for the whole
evolution, you can try to implement a new random generator that
returns the values from that list. Implementing a new random generator
is very simple, you just need to create a class that implements the
RandomGenerator class and override the methods that you need. In your
case one of the methods that you should implement is the nextInt
method.
In this way you can use whatever kind of business logic you want, for
example sequential extraction value from the list or random extraction
value from the list, you can shuffle the list and so on.
Remember that the random generator is used both for the random initial
genotype and mutation phase, so consider the impact of this solution
in your implementation case.

Cheers

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Giuseppe Quartarone
In reply to this post by Aziz Yasri-2
Hi Aziz
I'm new too, but I want to try to give my suggestion, maybe it might
be useful for you.
Well, if the the set of alleles values is the same for the whole
evolution, you can try to implement a new random generator that
returns the values from that list. Implementing a new random generator
is very simple, you just need to create a class that implements the
RandomGenerator class and override the methods that you need. In your
case one of the methods that you should implement is the nextInt
method.
In this way you can use whatever kind of business logic you want, for
example sequential extraction value from the list or random extraction
value from the list, you can shuffle the list and so on.
Remember that the random generator is used both for the random initial
genotype and mutation phase, so consider the impact of this solution
in your implementation case.
Sorry for previuos post, I'm wrongly sent the mail

Cheers

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Angela María
In reply to this post by Aziz Yasri-2
Hello Aziz.

Did you solve it? I have the same problem!


Aziz Yasri-2 wrote

Hello,

 

I am new to
JGAP library usage. I just wanted to create new Gene that can use alleles from
a defined set of alleles, let’s say from this list [1,2,3,10,20,30,78]. I
cannot use new IntegerGene method since it fill the Gene by integers values
between two values (lower-value and upper-value).

 

I just want
to create chromosomes like these ones where the allelles are taken from the list  [1,2,3,10,20,30,78]:

Ch1: 1 2 20

Ch2: 20 30
78

Ch3: 2 10 1



 

Any sample
code that perform this custom gene creation.

 

 

Best
regards

Aziz


     
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
jgap-users mailing list
jgap-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Klaus Meffert-5
Hello Angela & Azz,

have you tried org.jgap.impl.SetGene?
If this does not satisfy your needs, you can adapt SetGene or even
IntegerGene as JGAP is open-source.

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Angela R. [mailto:[hidden email]]
> Sent: Tuesday, May 28, 2013 5:47 AM
> To: [hidden email]
> Subject: Re: [jgap-users] custom Gene/Chromosome creation
>
>
> Hello Aziz.
>
> Did you solve it? I have the same problem!
>
>
>
> Aziz Yasri-2 wrote:
> >
> >
> >
> > Hello,
> >
> >  
> >
> > I am new to
> > JGAP library usage. I just wanted to create new Gene that can use
> > alleles from a defined set of alleles, let's say from this list
> > [1,2,3,10,20,30,78]. I cannot use new IntegerGene method
> since it fill
> > the Gene by integers values between two values (lower-value and
> > upper-value).
> >
> >  
> >
> > I just want
> > to create chromosomes like these ones where the allelles are taken
> > from the list  [1,2,3,10,20,30,78]:
> >
> > Ch1: 1 2 20
> >
> > Ch2: 20 30
> > 78
> >
> > Ch3: 2 10 1
> >
> > .
> >
> >  
> >
> > Any sample
> > code that perform this custom gene creation.
> >
> >  
> >
> >  
> >
> > Best
> > regards
> >
> > Aziz
> >
> >
> >      
> >
> ----------------------------------------------------------------------
> > -------- Minimize network downtime and maximize team effectiveness.
> > Reduce network management and security costs.Learn how to hire the
> > most talented Cisco Certified professionals. Visit the Employer
> > Resources Portal
> > http://www.cisco.com/web/learning/employer_resources/index.html
> > _______________________________________________
> > jgap-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/jgap-users
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/custom-Gene-Chromosome-creation-tp352521
95p35559763.html

> Sent from the jgap-users mailing list archive at Nabble.com.
>
>
> --------------------------------------------------------------
> ----------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance
> monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt!
> http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> jgap-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jgap-users
>


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Angela María
Hello Dr. Klauss,

Can you tell me in more detail the use of SetGene for such a custom gene we need?

Thank you.

Klaus Meffert-5 wrote
Hello Angela & Azz,

have you tried org.jgap.impl.SetGene?
If this does not satisfy your needs, you can adapt SetGene or even
IntegerGene as JGAP is open-source.

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Angela R. [mailto:angela.rodriguez.vivas@gmail.com]
> Sent: Tuesday, May 28, 2013 5:47 AM
> To: jgap-users@lists.sourceforge.net
> Subject: Re: [jgap-users] custom Gene/Chromosome creation
>
>
> Hello Aziz.
>
> Did you solve it? I have the same problem!
>
>
>
> Aziz Yasri-2 wrote:
> >
> >
> >
> > Hello,
> >
> >  
> >
> > I am new to
> > JGAP library usage. I just wanted to create new Gene that can use
> > alleles from a defined set of alleles, let's say from this list
> > [1,2,3,10,20,30,78]. I cannot use new IntegerGene method
> since it fill
> > the Gene by integers values between two values (lower-value and
> > upper-value).
> >
> >  
> >
> > I just want
> > to create chromosomes like these ones where the allelles are taken
> > from the list  [1,2,3,10,20,30,78]:
> >
> > Ch1: 1 2 20
> >
> > Ch2: 20 30
> > 78
> >
> > Ch3: 2 10 1
> >
> > .
> >
> >  
> >
> > Any sample
> > code that perform this custom gene creation.
> >
> >  
> >
> >  
> >
> > Best
> > regards
> >
> > Aziz
> >
> >
> >      
> >
> ----------------------------------------------------------------------
> > -------- Minimize network downtime and maximize team effectiveness.
> > Reduce network management and security costs.Learn how to hire the
> > most talented Cisco Certified professionals. Visit the Employer
> > Resources Portal
> > http://www.cisco.com/web/learning/employer_resources/index.html
> > _______________________________________________
> > jgap-users mailing list
> > jgap-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jgap-users
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/custom-Gene-Chromosome-creation-tp352521
95p35559763.html
> Sent from the jgap-users mailing list archive at Nabble.com.
>
>
> --------------------------------------------------------------
> ----------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance
> monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt!
> http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> jgap-users mailing list
> jgap-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jgap-users
>


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
jgap-users mailing list
jgap-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: custom Gene/Chromosome creation

Angela María
In reply to this post by Klaus Meffert-5
Hello Dr. Klaus ans Azz,

I already reached it!

I modified the method setToRandomValue as well as some variables in the IntegerGene class, and now it works exactly as exposed by Azz.

Klaus Meffert-5 wrote
Hello Angela & Azz,

have you tried org.jgap.impl.SetGene?
If this does not satisfy your needs, you can adapt SetGene or even
IntegerGene as JGAP is open-source.

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Angela R. [mailto:angela.rodriguez.vivas@gmail.com]
> Sent: Tuesday, May 28, 2013 5:47 AM
> To: jgap-users@lists.sourceforge.net
> Subject: Re: [jgap-users] custom Gene/Chromosome creation
>
>
> Hello Aziz.
>
> Did you solve it? I have the same problem!
>
>
>
> Aziz Yasri-2 wrote:
> >
> >
> >
> > Hello,
> >
> >  
> >
> > I am new to
> > JGAP library usage. I just wanted to create new Gene that can use
> > alleles from a defined set of alleles, let's say from this list
> > [1,2,3,10,20,30,78]. I cannot use new IntegerGene method
> since it fill
> > the Gene by integers values between two values (lower-value and
> > upper-value).
> >
> >  
> >
> > I just want
> > to create chromosomes like these ones where the allelles are taken
> > from the list  [1,2,3,10,20,30,78]:
> >
> > Ch1: 1 2 20
> >
> > Ch2: 20 30
> > 78
> >
> > Ch3: 2 10 1
> >
> > .
> >
> >  
> >
> > Any sample
> > code that perform this custom gene creation.
> >
> >  
> >
> >  
> >
> > Best
> > regards
> >
> > Aziz
> >
> >
> >      
> >
> ----------------------------------------------------------------------
> > -------- Minimize network downtime and maximize team effectiveness.
> > Reduce network management and security costs.Learn how to hire the
> > most talented Cisco Certified professionals. Visit the Employer
> > Resources Portal
> > http://www.cisco.com/web/learning/employer_resources/index.html
> > _______________________________________________
> > jgap-users mailing list
> > jgap-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jgap-users
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/custom-Gene-Chromosome-creation-tp352521
95p35559763.html
> Sent from the jgap-users mailing list archive at Nabble.com.
>
>
> --------------------------------------------------------------
> ----------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance
> monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt!
> http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> jgap-users mailing list
> jgap-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jgap-users
>


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
jgap-users mailing list
jgap-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jgap-users