<!doctype html public '-//W3C//DTD HTML 4.01//EN'
  'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<title>Isight - Examples</title>
  <head>
	<link rel="stylesheet" href="../../../EStyle.css" type="text/css">
	<link rel="stylesheet" href="../../../ETables.css" type="text/css">
  </head>
<a href="http://www.simulia.com/products/sim_opt.html"><img src="../../../../examples/logo.gif"></a>
<h1>Dynamic Modeling - Customization Scripts, Files, and (Component and Subflow) Prologue and Epilogue</h1>

<table>
	<th colspan=2>Customization - Dynamic Workflow Construction</th>
	<tr>
		<td>Description:</td>
		<td>This model illustrates the dynamic construction of a driver's child components and
		    workflow.  The root driver contains an in-model File parameter whose text consists
		    of a sequence of Calculation assignments; each line contains the complete equation
		    for a single output variable.  The model is customized by reading each equation and
		    creating a Calculator component to evaluate it.  All created Calculator components
		    are added to the MonteCarlo component's workflow in parallel since they are mutually
		    independent (they could easily have been formed into a sequential workflow instead).
		    Each Calculator component's output variable is added as a MonteCarlo response.

		    If the model is run using the 'Configure and Run Model' menu item, the contents of
		    the equations File may be edited before execution; if any equation line is deleted
		    or commented out (prefixed with '#'), the customization script will not build the
		    associated Calculator component.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="DynamicComps.zmf">DynamicComps.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Monte Carlo, Calculator</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Dynamic Java model-customization scripts, in-model File parameter stream-I/O
			utility, Monte Carlo API
		</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Model Template Instantiation</th>
	<tr>
		<td>Description:</td>
		<td>This model demonstrates the use of model customization scripts to create a design
		    search model for a specific application from a generic template model.  The base
		    template consists of a bare DOE component containing a bare Calculator component.
		    Neither component has any parameters, and the Calculator has no equations.  The
		    root component has an in-model File parameter whose text declares a set of parameters
		    for each component, specifies the Factor and Response settings  for the DOE
		    component, and gives the equations for the Calculator component.  The customization
		    scripts configure the model to perform the described DOE search over the
		    defined calculation.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="DynamicDOE.zmf">DynamicDOE.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>DOE, Calculator</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Python model-customization scripts, in-model File parameter
			stream-I/O utility, DOE API
		</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Optimization Formulation Configuration</th>
	<tr>
		<td>Description:</td>
		<td>This model demonstrates the use of model customization scripts to configure an
		    Optimization search model for a specific application.  The base model consists
		    of a bare Optimization component containing a Calculator component, the latter
		    being fully configured with inputs, outputs, and formulae.  The root component
		    has an in-model File parameter whose text defines the optimization to be done
		    over this Calculator.  It identifies all design variables, specifies input and
		    output constraints, gives the objectives, and selects the technique to be used.

			<p><b>NOTE:</b> This model uses a custom file format for the optimization
			configuration which should not be confused with the official file format
			supported by Isight design drivers as demonstrated in the Importing Driver
			Configuration example.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="DynamicOPT.zmf">DynamicOPT.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Optimization, Calculator, Script, Task</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Dynamic Java <i>and</i> Python model-customization scripts, in-model File parameter
			stream-I/O utility, Optimization API
		</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Preconfigured Driver Selection</th>
	<tr>
		<td>Description:</td>
		<td>This model demonstrates the use of model customization scripts to choose one of
		    several preconfigured driver components and apply it to a specific application.
		    The model consists of a root Task component containing a Calculator component,
		    the latter being fully configured with inputs, outputs, and formulae.  The Task
		    component also has surrogate driver components, each preconfigured to perform
		    one specific type of search (DOE, Monte Carlo, Optimization, or SDI) within the
		    space defined by the Calculator's formulae and graph the results.

		    The root has a String parameter whose allowed values are the names of the driver
		    components.  When one of these names is selected before the model is run (or is
		    selected via the 'Configure and Run Model' menu item), the model customization
		    script will change the root Task to the selected driver and run the resulting
		    model.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="DynamicSpring.zmf">DynamicSpring.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>DOE, Monte Carlo, Optimization, SDI, Calculator, Task</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Python model-customization scripts, 'change component' utility method</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Loading a Dynamic Java Script as a Model</th>
	<tr>
		<td>Description:</td>
		<td>This example demonstrates the use of customization to build and load a model
		    entirely from a script file.  The script constructs a Calculator to evaluate
		    a simple formula, under a Loop which runs it over a range of input values.
		    Isight creates a one-Task default model, sets the model-level customization
		    script to the text of the script file, customizes the default model, and
		    loads the customized result model.

		    To produce this model, start the Gateway (Design or Runtime), then select the
		    menu option 'File/Open' and select this script file.  You will be asked if
		    you wish to provide customization data; select 'no'.  A model will be created
		    and displayed in the Gateway.

		    Note: You can also make the model via the Command Client 'customize' command.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="Parabola.jav">Parabola.jav</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Loop, Calculator, Task</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Dynamic Java model-customization scripts, Gateway 'open' script-to-model process.</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Loading and Configuring a Python Script as a Model</th>
	<tr>
		<td>Description:</td>
		<td>This example demonstrates the use of customization to build and load a model
		    entirely from a script file.  The script constructs a Calculator to evaluate
		    the formulae for a metal spring, under an Optimization component which does a
		    design search within the range of validity of the formulae.  Isight creates a
		    one-Task default model, sets the model-level customization script to the text
		    of the script file, customizes the default model, and loads the customized
		    result model.

		    To produce this model, start the Gateway (Design or Runtime), then select the
		    menu option 'File/Open' and select this script file.  You will be asked if
		    you wish to provide customization data; select 'yes' and choose the name-value
		    file of the same name as the script file, which assigns input parameter values.
		    A model will be created and displayed in the Gateway.

		    Note: You can also make the model via the Command Client 'customize' command.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="SpringOpt.py">SpringOpt.py</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Optimization, Calculator, Task</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Python model-customization scripts, Gateway 'open' script-to-model process.</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Importing Driver Configuration</th>
	<tr>
		<td>Description:</td>
		<td>This simple model shows 2 different ways that a design driver can be dynamically  configured:
		<ol>
		<li>using the option to import configuration from a file at runtime, or
		<li>using the component API in a prologue to reconfigure the component, possibly setting options from values of parameters (but not defining new parameters on the component, which is only possible at design time).</li>
		</ol>
		<p>The root Task component contains a DOE that configures itself from a file at runtime, a DOE that configures itself at runtime using the DOE API in a prologue, a Monte Carlo that configures itself from a file at runtime, and a Monte Carlo that configures itself at runtime using the Monte Carlo API in a prologue.
		<p>For more information on importing configuration from a file, see the appendix in the Component Guide.  For more information on using the design driver component APIs, see the javadocs in your installation, in particular the com.engineous.sdk.designdriver package.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="ImportDriverConfig.zmf">ImportDriverConfig.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>DOE, Monte Carlo, Calculator</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Prologue, Import from file</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Exploiting Component and Subflow Epilogues</th>
	<tr>
		<td>Description:</td>
		<td>This model illustrates the combined use of a Component Epilogue and a Subflow
		    Epilogue to accumulate and post-process application-specific statistics.  The
		    Optimization component in this model has six extra parameters - three local,
		    three outputs - which are used to calculate and report the following data:
		    the total number of evaluated design points, the total number of feasible
		    design points, and the average Volume for all feasible design points.  The
		    Subflow Epilogue uses the three local parameters as accumulators to capture
		    data after each run; the Component Epilogue processes the accumulated values
		    and transfers them to the corresponding output parameters for presentation by
		    the subsequent Pause component.

			<p><b>NOTE:</b> The Subflow Epilogue uses the GLOBAL versions of the extra
			local parameters as accumulators, NOT the subflow versions.  This is required,
			as the subflow versions are different for each design point, and do not share
			a single updatable value record, so changes made in one design point need not
			be seen by other design points.

		    <p><b>WARNING:</b> This model's Optimization component is configured to restore
		    and rerun the best design point.  If the three extra output parameters were
		    used directly as accumulators, their values at the end of optimization would
		    be overridden by the values they had in the best design point when that point
		    is restored.  Therefore this model uses local parameters, which are not part
		    of the design point, as accumulators, and transfers them to their outputs in
		    the Component Epilogue.  The extra outputs could be used as accumulators if
		    the best point restore were disabled, but that might not be acceptable for
		    some applications.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="CantBeamOptReport.zmf">CantBeamOptReport.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Task, Optimization, Calculator, Pause</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Component Epilogue, Subflow Epilogue</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td>None</td>
	</tr>
</table>
<br>
<p>
<table>
	<th colspan=2>Customization - Building Isight model consisting of DOE and Data Exchanger components</th>
	<tr>
		<td>Description:</td>
		<td>This model illustrates the use of the Isight script component and the Java API to programatically create
		    an Isight model consisting of a DOE and a Data Exchanger component.  It produces a run ready Isight zmf file
		    called NewModel.zmf into current model directory.  Before running the resulting NewModel.zmf, 
		    copy the file input_temp to model directory of NewModel.zmf. This file
		    is the input file parameter to the Data Exchanger component.
		</td>
	</tr>
	<tr>
		<td>Model:</td>
		<td><a href="DOE-Datex-Builder.zmf">DOE-Datex-Builder.zmf</a></td>
	</tr>
	<tr>
		<td>Illustrated components:</td>
		<td>Task, DOE, Data Exchanger, Script</td>
	</tr>
	<tr>
		<td>Other illustrated features:</td>
		<td>Dynamic Java scripting</td>
	</tr>
	<tr>
		<td>Simcodes needed:</td>
		<td>None</td>
	</tr>
	<tr>
		<td>Support files needed:</td>
		<td><a href="input_temp.txt">input_temp.txt</a></td>
	</tr>
</table>
</html>
