A question about SuperGene

View: New views
2 Messages — Rating Filter:   Alert me  

A question about SuperGene

by Huazhi (Hank) Gong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear JGAP users,

According to the documents of SuperGene, we can use it for controlling the evoluation to fit for my own constraints.

Let me simply state my problem. In my case, I created a Supergene to include some BooleanGenes based on extending AbstractSuperGene. However, I noted that the isValid() function was only triggered once when the Supergene is randomly initialized. During the evoluation and mutation, isValid() was never used anymore. Then SuperGene is actually not as useful as it declares. Is it the original design or a bug?

Morever, I have searched the SuperGene problems in this maillist. There are two guys asking the same questions before; but nobody replied.


Regards,
Hank

Re: A question about SuperGene

by Klaus Meffert-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hank,

To have a validation on mutation for Supergene, it is necessary to extend
the mutation operator you are using. E.g, take
org.jgap.impl.MutationOperator. There the following logic should be extended
as follows (not tested, will be added to core logic soon):
...
          if (genes[j] instanceof ICompositeGene) {
            ICompositeGene compositeGene = (ICompositeGene) genes[j];
            for (int k = 0; k < compositeGene.size(); k++) {
              mutateGene(compositeGene.geneAt(k), generator);
            }
          }
// INSERT BEGIN
          else if (genes[j] instanceof org.jgap.supergenes.Supergene) {
            org.jgap.supergenes.Supergene superGene =
(org.jgap.supergenes.Supergene) genes[j];
            for (int k = 0; k < superGene.size(); k++) {
              mutateSupergene(superGene.geneAt(k), generator);
            }
          }
// INSERT END
          else {
            mutateGene(genes[j], generator);
          }

Then, add a method mutateSupergene, in analogy to mutateGene. But care, that
before applying mutation for the contained genes, the original genes is
cloned. After mutating, call isValid from supergene, and if not valid,
restore the original genes. Optionally try n times to get a valid supergene,
and if no success, return unmutated.

If the original designer of super genes, Audrius Meskauskas, reads this,
maybe he can contribute an idea.

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Huazhi (Hank) Gong [mailto:hankgong@...]
> Sent: Friday, May 29, 2009 6:21 PM
> To: jgap-users@...
> Subject: [jgap-users] A question about SuperGene
>
>
> Dear JGAP users,
>
> According to the documents of SuperGene, we can use it for
> controlling the evoluation to fit for my own constraints.
>
> Let me simply state my problem. In my case, I created a
> Supergene to include some BooleanGenes based on extending
> AbstractSuperGene. However, I noted that the isValid()
> function was only triggered once when the Supergene is
> randomly initialized. During the evoluation and mutation,
> isValid() was never used anymore. Then SuperGene is actually
> not as useful as it declares.
> Is it the original design or a bug?
>
> Morever, I have searched the SuperGene problems in this
> maillist. There are two guys asking the same questions
> before; but nobody replied.
>
>
> Regards,
> Hank
> --
> View this message in context:
> http://www.nabble.com/A-question-about-SuperGene-tp23782932p23
> 782932.html
> Sent from the jgap-users mailing list archive at Nabble.com.
>
>
> --------------------------------------------------------------
> ----------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity,
> Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights
> like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> jgap-users mailing list
> jgap-users@...
> https://lists.sourceforge.net/lists/listinfo/jgap-users


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
jgap-users mailing list
jgap-users@...
https://lists.sourceforge.net/lists/listinfo/jgap-users