Ignore:
Timestamp:
Feb 22, 2008 2:08:40 PM (16 years ago)
Author:
mmc
Message:

Added a -fitness option to the "perform" operation. Right now, you can
specify just the name of an output quantity, and that quantity can be
minimized or maximized. In the future, there should be an expression
parser so you can enter any function of Rappture quantities.

Fixed up the example so that it runs the Rosenbrock function, which is
difficult to minimize. Added a visualize.tcl script, so you can visualize
the output from many different runXXXX.xml files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/optimizer/src/plugin_pgapack.c

    r898 r899  
    1515 */
    1616#include "pgapack.h"
    17 #include "rp_optimizer_plugin.h"
     17#include "rp_optimizer.h"
    1818
    1919typedef struct PgapackData {
     
    9292 */
    9393RpOptimStatus
    94 PgapackRun(envPtr, evalProc)
     94PgapackRun(envPtr, evalProc, fitnessExpr)
    9595    RpOptimEnv *envPtr;           /* optimization environment */
    9696    RpOptimEvaluator *evalProc;   /* call this proc to run tool */
     97    char *fitnessExpr;            /* fitness function in string form */
    9798{
    9899    PgapackData *dataPtr =(PgapackData*)envPtr->pluginData;
     
    109110    PGASetPopSize(ctx, dataPtr->popSize);
    110111    PGASetPopReplaceType(ctx, dataPtr->popRepl);
     112    PGASetCrossoverType(ctx, PGA_CROSSOVER_UNIFORM);
    111113
    112114    PGASetUserFunction(ctx, PGA_USERFUNCTION_CREATESTRING, PgapCreateString);
     
    118120    PGASetUserFunction(ctx, PGA_USERFUNCTION_BUILDDATATYPE, PgapBuildDT);
    119121
    120     envPtr->evalProc = evalProc;  /* call this later for evaluations */
     122    envPtr->evalProc = evalProc;   /* plug these in for later during eval */
     123    envPtr->fitnessExpr = fitnessExpr;
    121124
    122125    /*
Note: See TracChangeset for help on using the changeset viewer.