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.

Location:
trunk/optimizer/examples
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/optimizer/examples/simple.tcl

    r898 r899  
    4848Rappture::optimizer optim -tool $tool -using pgapack
    4949
    50 optim add number input.number(temperature) -min 200 -max 400
    51 optim add number input.number(Ef) -min 0 -max 1.1
    52 optim configure -popsize 500 -maxruns 5
     50optim add number input.number(x1) -min -2 -max 2
     51optim add number input.number(x2) -min -2 -max 2
     52optim configure -operation minimize -popsize 100 -maxruns 200
    5353
    54 set status [optim perform -updatecommand {puts "checking"}]
     54set status [optim perform \
     55    -fitness output.number(f).current \
     56    -updatecommand {puts "checking"}]
    5557
    5658puts "done: $status"
  • trunk/optimizer/examples/tool.xml

    r898 r899  
    22<run>
    33    <tool>
    4         <about>Press Simulate to view results.</about>
    5         <command>tclsh @tool/fermi.tcl @driver</command>
     4        <about>This tool is a good example for optimization.  It implements the Rosenbrock function:
     5
     6f(x1,x2) = 100(x2 - x1**2)**2 + (1-x1)**2
     7
     8This has a minimum at (x1,x2) = (1,1).
     9
     10Press Simulate to view results.</about>
     11        <command>tclsh @tool/rosenbrock.tcl @driver</command>
    612    </tool>
    713    <input>
    8         <number id="temperature">
     14        <number id="x1">
    915            <about>
    10                 <label>Ambient temperature</label>
    11                 <description>Temperature of the environment.</description>
     16                <label>X1</label>
     17                <description>first coordinate</description>
    1218            </about>
    13             <units>K</units>
    14             <min>0K</min>
    15             <max>500K</max>
    16             <default>300K</default>
    17             <preset>
    18                 <value>300K</value>
    19                 <label>300K (room temperature)</label>
    20             </preset>
    21             <preset>
    22                 <value>77K</value>
    23                 <label>77K (liquid nitrogen)</label>
    24             </preset>
    25             <preset>
    26                 <value>4.2K</value>
    27                 <label>4.2K (liquid helium)</label>
    28             </preset>
     19            <min>-2</min>
     20            <max>2</max>
     21            <default>0</default>
    2922        </number>
    30         <number id="Ef">
     23        <number id="x2">
    3124            <about>
    32                 <label>Fermi Level</label>
    33                 <description>Energy at center of distribution.</description>
     25                <label>X2</label>
     26                <description>second coordinate</description>
    3427            </about>
    35             <units>eV</units>
    36             <min>-10eV</min>
    37             <max>10eV</max>
    38             <default>0eV</default>
     28            <min>-2</min>
     29            <max>2</max>
     30            <default>0</default>
    3931        </number>
    4032    </input>
    4133</run>
    42 
Note: See TracChangeset for help on using the changeset viewer.