Ignore:
Timestamp:
Oct 29, 2008 12:16:26 PM (14 years ago)
Author:
liveletlive
Message:

Changes made to include the following items:
1) Hard restart
2) SBX
3) Random population replacement proportion
4) Definitions and macros for the above functions in pgapack.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/optimizer/src/pgapack/pgapack/source/duplcate.c

    r816 r1202  
    198198                   PGA_DOUBLE, (void *) &mr );
    199199
    200     while (( changed == PGA_FALSE ) && (mr <= 1.0)) {
    201         if (ctx->fops.Mutation) {
    202             fp = ((p == PGA_TEMP1) || (p == PGA_TEMP2)) ? p : p+1;
    203             nflips = (*ctx->fops.Mutation)(&ctx, &fp, &pop, &mr);
    204         } else {
    205             nflips = (*ctx->cops.Mutation)( ctx, p, pop, mr );
    206         }
    207 
    208         if ( nflips > 0 )
    209             changed = PGA_TRUE;
    210         else
    211             mr = 1.1*mr;
     200/**TODO: GTG (Clear)I dont see why we need to wait for iterations to mutate?****/
     201/**TODO: can't we directly set mr = 1??**/
     202    while (changed == PGA_FALSE) {
     203                if (ctx->fops.Mutation) {
     204                    fp = ((p == PGA_TEMP1) || (p == PGA_TEMP2)) ? p : p+1;
     205                    nflips = (*ctx->fops.Mutation)(&ctx, &fp, &pop, &mr);
     206                } else {
     207                        nflips = (*ctx->cops.Mutation)( ctx, p, pop, mr );
     208                }
     209       
     210                if ( nflips > 0 )
     211                    changed = PGA_TRUE;
     212                else
     213                    mr = ( mr>1 ? 1 :1.1*mr);
     214                   
    212215    }
    213216
Note: See TracChangeset for help on using the changeset viewer.