Dynamic fitness

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

Dynamic fitness

Simone Bronzin
Hi all,

I'm trying to use JGAP GP package to solve a dynamic problem, i.e. the  
fitness function (and problem solution) changes in time, so  fitness  
should be recalculated at every generation for all the programs.

is there any way to archive this with GPGenotype & GPProgramBase  
current implementation or should I write derived classes?


--

Simone Bronzin
Unitary
Executive

mobile: +39.3939459672





------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic fitness

Klaus Meffert-5
Hello Simone,

you can do this, e.g., by using an event listener that is called after every
generation:
      config.getEventManager().addEventListener(GeneticEvent.
          GPGENOTYPE_EVOLVED_EVENT, new GeneticEventListener() {
...

See class examples.gp.Fibonacci for an example.

In this listener you can recalculcate the fitness values of all individuals.

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Simone Bronzin [mailto:[hidden email]]
> Sent: Sunday, December 20, 2009 10:39 PM
> To: [hidden email]
> Subject: [jgap-users] Dynamic fitness
>
> Hi all,
>
> I'm trying to use JGAP GP package to solve a dynamic problem,
> i.e. the fitness function (and problem solution) changes in
> time, so  fitness should be recalculated at every generation
> for all the programs.
>
> is there any way to archive this with GPGenotype &
> GPProgramBase current implementation or should I write
> derived classes?
>
>
> --
>
> Simone Bronzin
> Unitary
> Executive
>
> mobile: +39.3939459672
>
>
>
>
>
> --------------------------------------------------------------
> ----------------
> This SF.Net email is sponsored by the Verizon Developer
> Community Take advantage of Verizon's best-in-class app
> development support A streamlined, 14 day to market process
> makes app distribution fast and easy Join now and get one
> step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> jgap-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jgap-users


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic fitness

Simone Bronzin
Hi Klaus,

thank you for your quick response. Another question: if the fitness is  
recalculated in that event listener, can I be sure that calling  
GPGenotype.evolve() doesn't calculate any fitness again? Calculating  
this fitness is very time expensive, so I need to be sure that it's  
calculated just one time for each program and generation.

Thank you,

Simone


Klaus Meffert <[hidden email]> ha scritto:

> Hello Simone,
>
> you can do this, e.g., by using an event listener that is called after every
> generation:
>       config.getEventManager().addEventListener(GeneticEvent.
>           GPGENOTYPE_EVOLVED_EVENT, new GeneticEventListener() {
> ...
>
> See class examples.gp.Fibonacci for an example.
>
> In this listener you can recalculcate the fitness values of all individuals.
>
> Best
>
> Klaus
> www.klaus-meffert.com
>
>
>
>> -----Original Message-----
>> From: Simone Bronzin [mailto:[hidden email]]
>> Sent: Sunday, December 20, 2009 10:39 PM
>> To: [hidden email]
>> Subject: [jgap-users] Dynamic fitness
>>
>> Hi all,
>>
>> I'm trying to use JGAP GP package to solve a dynamic problem,
>> i.e. the fitness function (and problem solution) changes in
>> time, so  fitness should be recalculated at every generation
>> for all the programs.
>>
>> is there any way to archive this with GPGenotype &
>> GPProgramBase current implementation or should I write
>> derived classes?
>>
>>
>> --
>>
>> Simone Bronzin
>> Unitary
>> Executive
>>
>> mobile: +39.3939459672
>>
>>
>>
>>
>>
>> --------------------------------------------------------------
>> ----------------
>> This SF.Net email is sponsored by the Verizon Developer
>> Community Take advantage of Verizon's best-in-class app
>> development support A streamlined, 14 day to market process
>> makes app distribution fast and easy Join now and get one
>> step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> jgap-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jgap-users
>
>



Simone Bronzin
Unitary
Executive

mobile: +39.3939459672
phone: +39.




------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic fitness

Klaus Meffert-5
Simone,

you can iterate over the population of individuals and recalculate the
fitness of each individual that you find appropriate for doing so.
My suggestion was not to use GPGenotype.evolve().

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Simone Bronzin [mailto:[hidden email]]
> Sent: Tuesday, December 22, 2009 4:07 PM
> To: Klaus Meffert
> Cc: [hidden email]
> Subject: RE: [jgap-users] Dynamic fitness
>
> Hi Klaus,
>
> thank you for your quick response. Another question: if the
> fitness is recalculated in that event listener, can I be sure
> that calling
> GPGenotype.evolve() doesn't calculate any fitness again?
> Calculating this fitness is very time expensive, so I need to
> be sure that it's calculated just one time for each program
> and generation.
>
> Thank you,
>
> Simone
>
>
> Klaus Meffert <[hidden email]> ha scritto:
>
> > Hello Simone,
> >
> > you can do this, e.g., by using an event listener that is
> called after
> > every
> > generation:
> >       config.getEventManager().addEventListener(GeneticEvent.
> >           GPGENOTYPE_EVOLVED_EVENT, new GeneticEventListener() { ...
> >
> > See class examples.gp.Fibonacci for an example.
> >
> > In this listener you can recalculcate the fitness values of
> all individuals.
> >
> > Best
> >
> > Klaus
> > www.klaus-meffert.com
> >
> >
> >
> >> -----Original Message-----
> >> From: Simone Bronzin [mailto:[hidden email]]
> >> Sent: Sunday, December 20, 2009 10:39 PM
> >> To: [hidden email]
> >> Subject: [jgap-users] Dynamic fitness
> >>
> >> Hi all,
> >>
> >> I'm trying to use JGAP GP package to solve a dynamic problem, i.e.
> >> the fitness function (and problem solution) changes in time, so  
> >> fitness should be recalculated at every generation for all the
> >> programs.
> >>
> >> is there any way to archive this with GPGenotype & GPProgramBase
> >> current implementation or should I write derived classes?
> >>
> >>
> >> --
> >>
> >> Simone Bronzin
> >> Unitary
> >> Executive
> >>
> >> mobile: +39.3939459672
> >>
> >>
> >>
> >>
> >>
> >> --------------------------------------------------------------
> >> ----------------
> >> This SF.Net email is sponsored by the Verizon Developer Community
> >> Take advantage of Verizon's best-in-class app development
> support A
> >> streamlined, 14 day to market process makes app
> distribution fast and
> >> easy Join now and get one step closer to millions of Verizon
> >> customers http://p.sf.net/sfu/verizon-dev2dev
> >> _______________________________________________
> >> jgap-users mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/jgap-users
> >
> >
>
>
>
> Simone Bronzin
> Unitary
> Executive
>
> mobile: +39.3939459672
> phone: +39.
>
>
>


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic fitness

Simone Bronzin
Did you mean not to use directly GPGenotype.evolve() and use the  
runnable interface as in the fibonacci example? In any case .evolve()  
is called by run(), right?

Ty,

Simone


Klaus Meffert <[hidden email]> ha scritto:

> Simone,
>
> you can iterate over the population of individuals and recalculate the
> fitness of each individual that you find appropriate for doing so.
> My suggestion was not to use GPGenotype.evolve().
>
> Best
>
> Klaus
> www.klaus-meffert.com
>
>
>
>> -----Original Message-----
>> From: Simone Bronzin [mailto:[hidden email]]
>> Sent: Tuesday, December 22, 2009 4:07 PM
>> To: Klaus Meffert
>> Cc: [hidden email]
>> Subject: RE: [jgap-users] Dynamic fitness
>>
>> Hi Klaus,
>>
>> thank you for your quick response. Another question: if the
>> fitness is recalculated in that event listener, can I be sure
>> that calling
>> GPGenotype.evolve() doesn't calculate any fitness again?
>> Calculating this fitness is very time expensive, so I need to
>> be sure that it's calculated just one time for each program
>> and generation.
>>
>> Thank you,
>>
>> Simone
>>
>>
>> Klaus Meffert <[hidden email]> ha scritto:
>>
>> > Hello Simone,
>> >
>> > you can do this, e.g., by using an event listener that is
>> called after
>> > every
>> > generation:
>> >       config.getEventManager().addEventListener(GeneticEvent.
>> >           GPGENOTYPE_EVOLVED_EVENT, new GeneticEventListener() { ...
>> >
>> > See class examples.gp.Fibonacci for an example.
>> >
>> > In this listener you can recalculcate the fitness values of
>> all individuals.
>> >
>> > Best
>> >
>> > Klaus
>> > www.klaus-meffert.com
>> >
>> >
>> >
>> >> -----Original Message-----
>> >> From: Simone Bronzin [mailto:[hidden email]]
>> >> Sent: Sunday, December 20, 2009 10:39 PM
>> >> To: [hidden email]
>> >> Subject: [jgap-users] Dynamic fitness
>> >>
>> >> Hi all,
>> >>
>> >> I'm trying to use JGAP GP package to solve a dynamic problem, i.e.
>> >> the fitness function (and problem solution) changes in time, so
>> >> fitness should be recalculated at every generation for all the
>> >> programs.
>> >>
>> >> is there any way to archive this with GPGenotype & GPProgramBase
>> >> current implementation or should I write derived classes?
>> >>
>> >>
>> >> --
>> >>
>> >> Simone Bronzin
>> >> Unitary
>> >> Executive
>> >>
>> >> mobile: +39.3939459672
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --------------------------------------------------------------
>> >> ----------------
>> >> This SF.Net email is sponsored by the Verizon Developer Community
>> >> Take advantage of Verizon's best-in-class app development
>> support A
>> >> streamlined, 14 day to market process makes app
>> distribution fast and
>> >> easy Join now and get one step closer to millions of Verizon
>> >> customers http://p.sf.net/sfu/verizon-dev2dev
>> >> _______________________________________________
>> >> jgap-users mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/jgap-users
>> >
>> >
>>
>>
>>
>> Simone Bronzin
>> Unitary
>> Executive
>>
>> mobile: +39.3939459672
>> phone: +39.
>>
>>
>>
>
>



Simone Bronzin
Unitary
Executive

mobile: +39.3939459672
phone: +39.




------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic fitness

Klaus Meffert-5
Simone,

admitted, with the Fibonacci example it is quite difficult to follow.

Maybe this is easier:
    while (true) { //replace "true" with your stop condition or add a break
within the while-loop
      gp.evolve();
      // your additional code here
    }

Best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Simone Bronzin [mailto:[hidden email]]
> Sent: Friday, January 01, 2010 6:07 PM
> To: Klaus Meffert
> Cc: [hidden email]
> Subject: RE: [jgap-users] Dynamic fitness
>
> Did you mean not to use directly GPGenotype.evolve() and use
> the runnable interface as in the fibonacci example? In any
> case .evolve() is called by run(), right?
>
> Ty,
>
> Simone
>
>
> Klaus Meffert <[hidden email]> ha scritto:
>
> > Simone,
> >
> > you can iterate over the population of individuals and
> recalculate the
> > fitness of each individual that you find appropriate for doing so.
> > My suggestion was not to use GPGenotype.evolve().
> >
> > Best
> >
> > Klaus
> > www.klaus-meffert.com
> >
> >
> >
> >> -----Original Message-----
> >> From: Simone Bronzin [mailto:[hidden email]]
> >> Sent: Tuesday, December 22, 2009 4:07 PM
> >> To: Klaus Meffert
> >> Cc: [hidden email]
> >> Subject: RE: [jgap-users] Dynamic fitness
> >>
> >> Hi Klaus,
> >>
> >> thank you for your quick response. Another question: if the
> >> fitness is recalculated in that event listener, can I be sure
> >> that calling
> >> GPGenotype.evolve() doesn't calculate any fitness again?
> >> Calculating this fitness is very time expensive, so I need to
> >> be sure that it's calculated just one time for each program
> >> and generation.
> >>
> >> Thank you,
> >>
> >> Simone
> >>
> >>
> >> Klaus Meffert <[hidden email]> ha scritto:
> >>
> >> > Hello Simone,
> >> >
> >> > you can do this, e.g., by using an event listener that is
> >> called after
> >> > every
> >> > generation:
> >> >       config.getEventManager().addEventListener(GeneticEvent.
> >> >           GPGENOTYPE_EVOLVED_EVENT, new
> GeneticEventListener() { ...
> >> >
> >> > See class examples.gp.Fibonacci for an example.
> >> >
> >> > In this listener you can recalculcate the fitness values of
> >> all individuals.
> >> >
> >> > Best
> >> >
> >> > Klaus
> >> > www.klaus-meffert.com
> >> >
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Simone Bronzin [mailto:[hidden email]]
> >> >> Sent: Sunday, December 20, 2009 10:39 PM
> >> >> To: [hidden email]
> >> >> Subject: [jgap-users] Dynamic fitness
> >> >>
> >> >> Hi all,
> >> >>
> >> >> I'm trying to use JGAP GP package to solve a dynamic
> problem, i.e.
> >> >> the fitness function (and problem solution) changes in time, so
> >> >> fitness should be recalculated at every generation for all the
> >> >> programs.
> >> >>
> >> >> is there any way to archive this with GPGenotype & GPProgramBase
> >> >> current implementation or should I write derived classes?
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> Simone Bronzin
> >> >> Unitary
> >> >> Executive
> >> >>
> >> >> mobile: +39.3939459672
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --------------------------------------------------------------
> >> >> ----------------
> >> >> This SF.Net email is sponsored by the Verizon Developer
> Community
> >> >> Take advantage of Verizon's best-in-class app development
> >> support A
> >> >> streamlined, 14 day to market process makes app
> >> distribution fast and
> >> >> easy Join now and get one step closer to millions of Verizon
> >> >> customers http://p.sf.net/sfu/verizon-dev2dev
> >> >> _______________________________________________
> >> >> jgap-users mailing list
> >> >> [hidden email]
> >> >> https://lists.sourceforge.net/lists/listinfo/jgap-users
> >> >
> >> >
> >>
> >>
> >>
> >> Simone Bronzin
> >> Unitary
> >> Executive
> >>
> >> mobile: +39.3939459672
> >> phone: +39.
> >>
> >>
> >>
> >
> >
>
>
>
> Simone Bronzin
> Unitary
> Executive
>
> mobile: +39.3939459672
> phone: +39.
>
>
>


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users