<html>
  <head>
    <title>Isight - External Executable Optimizer Example</title>
    <link rel="stylesheet" href="../../../EStyle.css" type="text/css">
    <link rel="stylesheet" href="../../../ETables.css" type="text/css">
  </head>
<body>
<a href="http://www.simulia.com/products/sim_opt.html"><img src="../../../../examples/logo.gif"></a>
<h1>External Executable Optimizer Plug-in</h1>
<table>
    <tr><td>Description:</td>
        <td>This example demonstrates how to integrate into Isight an optimization plug-in 
            implemented as an external executable program. Such implementation of a plug-in 
            does not require 
            that you have any Java knowledge as there is no custom Java code required. Only
            an external executable program must be created, such that it is capable of
            communicating with Isight by reading and writing special files as described
            in the Isight Development Guide. <br><br>In this particular example, Hooke-Jeeves
            algorithm is used for demonstrating the capability of integrating an external 
	    executable optimization plug-in. This is the same algorithm as the Java-based 
	    Hooke-Jeeves plug-in supplied with Isight's Optimization component.
        </td>
    </tr>
    <tr><td>Support files:</td>
        <td>
            <ul>
                <li><a href="hooke.c">hooke.c</a> -
                C source code for the Hooke-Jeeves algorithm which is capable of
                    communicating with Isight by reading and writing all required files. 
                </li>
            </ul>
        </td>
    </tr>
    <tr><td>Instructions:</td>
        <td>
        <ol>
    <li>You must have a C-compiler installed on your machine. Compile the provided C-source file 
        (<a href = "hooke.c">hooke.c</a>) to create an executable program called "hooke.exe". <br>
        On Windows the compilation command may look like this: "<i><b>cl -o hooke.exe hooke.c</b></i>" <br>
        On Unix the compilation command may look like this: "<i><b>cc -lm -o hooke.exe hooke.c</b></i>"
        <br><br>

    <li>Open Isight SDK Generator. Select "New - Plug-in" command from the "File" menu. Select
        "Optimization Technique" on the small dialog window and click OK to create a new optimization plug-in.
        <br><br>
        <img src="SDK-Generator-New-Opt-Plugin.png">
        <br><br>

    <li>Click "Name" to open the "Name" page. Enter plug-in name, display name, version, 
        description as shown on the picture below.
        <br><br>
        <img src="SDK-Generator-Name.png">
        <br><br>

    <li>Click "Technique Options" to open the "Technique Options" page. 
        Create technique options as shown on the picture below. The provided C-source file is
        expecting to find these technique options at run-time, and it will create a log file with
        debugging messages using the file name shown on the picture below.
        <br><br>
        <img src="SDK-Generator-Tech-Options.png">
        <br><br>

   <li>Click "Java Wrapper" to open the "Java Wrapper" page. Click the top radio button
        "Call external executable directly without a Java wrapper". Click "Add Program to JAR..." button to invoke
        a dialog for adding your executable program to the JAR file of your new plug-in.
        <br><br>
        <img src="SDK-Generator-Java-Wrapper.png">
        <br><br>

    <li>On the small pop-up dialog, click "Browse" button and find
        the executable file that you created in step 1. 
        Change the "OS Platform" selection to reflect the OS platform that you compiled the executable on. 
        Click "Add to JAR file" button at the bottom of the small
        dialog. If you plan to use your optimization plug-in on multiple platforms, repeat this step. You
        must have compiled your executable program on all desired OS platforms prior to this step.
        <br><br>
        <img src="SDK-Generator-Publish-Exe.png">
        <br><br>

    <li>Select "Publish" command from the "File" menu or click "Publish" button on the toolbar to invoke a
        publishing dialog for your new optimization plug-in. Verify that all
        information is correct. Click "Publish" button at the bottom of the dialog. This will create a JAR
        file and publish it to the Isight library.
        <br><br>
        <img src="SDK-Generator-Publish-JAR.png">
        <br><br>

    <li>You may now build models using the new optimization plug-in. On the Optimization component editor,
        select the new optimization technique that you created and published to Isight library. Configure technique
        options and select design variables, constraints, objectives. Execute the model.
        <br><br>
        <img src="Optimization-Editor.png">
        </ol>
        </td>
    </tr>
</table>
</body>
</html>
