Ignore:
Timestamp:
Feb 22, 2008 2:08:40 PM (15 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/rp_optimizer.h

    r898 r899  
    2323#include <string.h>
    2424#include <malloc.h>
     25#include "rp_tcloptions.h"
    2526
    2627/*
     
    4849
    4950typedef RpOptimStatus (RpOptimHandler) _ANSI_ARGS_((
    50     struct RpOptimEnv *envPtr, RpOptimEvaluator *evalProc));
     51    struct RpOptimEnv *envPtr, RpOptimEvaluator *evalProc,
     52    char *fitnessExpr));
     53
     54/*
     55 * Each optimization package is plugged in to this infrastructure
     56 * by defining the following data at the top of rp_optimizer_tcl.c
     57 */
     58typedef struct RpOptimPlugin {
     59    char *name;                   /* name of this package for -using */
     60    RpOptimInit *initProc;        /* initialization routine */
     61    RpOptimHandler *runProc;      /* handles the core optimization */
     62    RpOptimCleanup *cleanupProc;  /* cleanup routine */
     63    RpTclOption *optionSpec;      /* specs for config options */
     64} RpOptimPlugin;
    5165
    5266/*
     
    98112 */
    99113typedef struct RpOptimEnv {
     114    RpOptimPlugin *pluginDefn;      /* plug-in handling this optimization */
     115    ClientData pluginData;          /* data created by plugin init routine */
    100116    RpOptimEvaluator *evalProc;     /* called during optimization to do run */
    101     ClientData pluginData;          /* data created by plugin init routine */
    102     RpOptimCleanup *cleanupProc;    /* cleanup routine for pluginData */
     117    char *fitnessExpr;              /* fitness function in string form */
    103118    ClientData toolData;            /* data used during tool execution */
    104119    RpOptimParam **paramList;       /* list of input parameters to vary */
     
    110125 *  Here are the functions in the API:
    111126 */
    112 EXTERN RpOptimEnv* RpOptimCreate _ANSI_ARGS_((ClientData pluginData,
    113     RpOptimCleanup *cleanupProc));
     127EXTERN RpOptimEnv* RpOptimCreate _ANSI_ARGS_((RpOptimPlugin *pluginDefn));
    114128
    115129EXTERN RpOptimParam* RpOptimAddParamNumber _ANSI_ARGS_((RpOptimEnv *envPtr,
Note: See TracChangeset for help on using the changeset viewer.