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/random.c

    r816 r1202  
    403403    PGADebugExited("PGASetRandomSeed");
    404404}
     405
     406/*****************************************************************************
     407 Category: Generation/Utility
     408 
     409 Inputs:
     410                ctx - context variable
     411                randreplaceprop - proportion of individuals to be replaced per generation randomly, post initialization
     412               
     413 Outputs:
     414                None
     415               
     416 Example:
     417        PGAContext *ctx;
     418        .
     419        .
     420        PGASetRandReplProp(ctx, 0.05);         
     421 ***************************************************************************/
     422void PGASetRandReplProp(PGAContext *ctx, double randreplprop){
     423        PGADebugEntered("PGASetRandReplProp");
     424        PGAFailIfSetUp("PGASetRandReplProp");
     425        if(randreplprop < 0 || randreplprop > 1){
     426                PGAError ( ctx, "PGASetRandReplProp: Invalid value set:",
     427                  PGA_FATAL, PGA_DOUBLE, (void *) &randreplprop);
     428        }else{
     429                ctx->ga.randreplprop = randreplprop;
     430        }
     431        PGADebugExited("PGASetRandReplProp");
     432}
     433
     434/*****************************************************************************
     435 Category: Generation/Utility
     436 
     437 Inputs:
     438                ctx - context variable
     439               
     440 Outputs:
     441                randreplprop - proportion of randomly generated individuals per population, post initialization
     442               
     443 Example:
     444        PGAContext *ctx;
     445        double randreplprop;
     446        .
     447        .
     448        randreplprop = PGAGetRandReplProp(ctx);         
     449 ***************************************************************************/
     450double PGAGetRandReplProp(PGAContext *ctx){
     451        PGADebugEntered("PGAGetRandReplProp");
     452        PGADebugExited("PGAGetRandReplProp");
     453        return ctx->ga.randreplprop;
     454}
Note: See TracChangeset for help on using the changeset viewer.