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

    r898 r899  
    3333 */
    3434RpOptimEnv*
    35 RpOptimCreate(pluginData, cleanupProc)
    36     ClientData pluginData;        /* special data created for this env */
    37     RpOptimCleanup *cleanupProc;  /* routine to clean up pluginData */
     35RpOptimCreate(pluginDefn)
     36    RpOptimPlugin *pluginDefn;    /* plug-in handling this optimization */
    3837{
    3938    RpOptimEnv *envPtr;
    4039    envPtr = (RpOptimEnv*)malloc(sizeof(RpOptimEnv));
    41     envPtr->pluginData  = pluginData;
    42     envPtr->cleanupProc = cleanupProc;
    43     envPtr->toolData    = NULL;
     40
     41    envPtr->pluginDefn = pluginDefn;
     42    envPtr->pluginData = NULL;
     43    envPtr->toolData   = NULL;
     44
     45    if (pluginDefn->initProc) {
     46        envPtr->pluginData = (*pluginDefn->initProc)();
     47    }
    4448
    4549    envPtr->numParams = 0;
     
    211215    int n;
    212216
     217    if (envPtr->pluginDefn && envPtr->pluginDefn->cleanupProc) {
     218        (*envPtr->pluginDefn->cleanupProc)(envPtr->pluginData);
     219    }
    213220    for (n=0; n < envPtr->numParams; n++) {
    214221        RpOptimCleanupParam(envPtr->paramList[n]);
    215     }
    216     if (envPtr->cleanupProc) {
    217         (*envPtr->cleanupProc)(envPtr->pluginData);
    218222    }
    219223    free(envPtr->paramList);
Note: See TracChangeset for help on using the changeset viewer.