problems with `nBestGenomes'

Thomas Binder binder at iue.tuwien.ac.at
Wed Mar 29 04:59:16 EST 2000


Hi everybody!

It seems I found the solution to my bounds problem.

Thomas Binder wrote:
> 
> 
> ----------------------- test program ---------------------
> 
> [...]
> 
> struct MyRealGenome: public GARealGenome
> {
>         MyRealGenome(GARealAlleleSetArray& arr_, float(*obj_)(GAGenome&))
>                 :GARealGenome(arr_, obj_)
>         {}
> 
> 
>         MyRealGenome(const MyRealGenome& cp): GARealGenome(cp)
>         {}
> 
>         virtual GAGenome* clone(CloneMethod) const
>         {
>                 return new MyRealGenome(*this);
>         }
> 
>         virtual void copy(const GAGenome& orig)
>         {
>                 if ((GAGenome*)this == &orig)   return;
> 
>                 GAGenome::copy(orig);

Here the constructor of the DIRECT base class must be called. The correct
statement therefore is:

		GARealGenome::copy(orig);
> [...]

That was it.

Sorry for bothering,

best regards,
Tom
-- 
"Computers are like air conditioners - they stop working properly when you open
 Windows"
                            \\\|///
                          \\  ~ ~  //
                           (  @ @  )
/------------------------oOOo-(_)-oOOo-----------------------------------------\
| Thomas Binder                        |                                       |
| Institute for  Microelectronics      | phone: ++43/1/58801-36036             |
| Technical University Vienna          |                                       |
| Gusshausstrasse  27-29 / E360        | fax  : ++43/1/58801-36099             |
| A-1040  Vienna                       |                                       |
| A U S T R I A                        | email: binder at iue.tuwien.ac.at        |
\---------------------------------Oooo.----------------------------------------/
                        .oooO     (   )
                        (   )      ) /
                         \ (      (_/
                          \_)





More information about the galib mailing list