Ignore:
Timestamp:
Feb 4, 2009 10:27:21 AM (14 years ago)
Author:
liveletlive
Message:

Committing additions made for including time of execution as a stoppage criteria.
also committing some changes to pgapack.h required to make these changes in stoppage criteria.
This code is yet untested, and will be tested once some more test benches are added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/optimizer/src/pgapack/pgapack/include/pgapack.h

    r1202 r1272  
    137137#define PGA_STOP_NOCHANGE       2    /* Stop: no change in best string    */
    138138#define PGA_STOP_TOOSIMILAR     4    /* Stop: homogeneous population      */
     139#define PGA_STOP_AV_FITNESS     5    /* Stop: if within a certain % of target av.fitness per pop.*/
     140#define PGA_STOP_BEST_FITNESS   6    /* Stop: if best fitness in a pop is within % of target best fitness*/
     141#define PGA_STOP_VARIANCE       7        /* Stop: if variance of fitness in pop is within % of target variance */
     142#define PGA_STOP_TIMEELAPSED    8        /* Stop: if elapsed time >= target*/
    139143
    140144/*****************************************
     
    145149#define PGA_CROSSOVER_UNIFORM   3    /* Uniform   crossover                */
    146150#define PGA_CROSSOVER_SBX               4    /* Simulated Binary crossover                 */
    147 
     151#define PGA_CROSSOVER_TRIANGULAR 5   /* Triangular Crossover*/
    148152/*****************************************
    149153*            SELECTION                   *
     
    252256    int PopSize;             /* Number of strings to use                  */
    253257    int StringLen;           /* string lengths                            */
     258    double TgtFitnessVal;                /* Target Fitness, best or average depending on stpg criteria*/
     259    double FitnessTol;           /* Min Fitness Tolerance to be achieved for stoppage*/
     260    double TgtFitnessVar;       /* Target Fitness Variance for stoppage */
     261    double VarTol;                       /* Tolerance for variance to be achieved for stoppage*/       
     262    double TgtElapsedTime;   /* Max Execution time of GA before stoppage */
    254263    int StoppingRule;        /* Termination Criteria                      */
    255264    int MaxIter;             /* Maximum number of iterations to run       */
     
    338347     double Online;
    339348     double Average;
     349     double Variance;
    340350     double Best;
    341351     time_t starttime;
     
    799809void PGASetMaxNoChangeValue(PGAContext *ctx, int max_no_change);
    800810void PGASetMaxSimilarityValue(PGAContext *ctx, int max_similarity);
     811void PGASetTgtFitnessVal(PGAContext *ctx, double tgt_fitness_val);
     812void PGASetFitnessTol(PGAContext *ctx,double fitness_tol);
     813void PGASetTgtFitnessVariance(PGAContext *ctx,double tgt_fitness_var);
     814void PGASetVarTol(PGAContext *ctx,double var_tol);
     815void PGASetTgtElapsedTime(PGAContext *ctx,double tgt_elapsed_time);
    801816
    802817/*****************************************
Note: See TracChangeset for help on using the changeset viewer.