The script library has wide range of examples with different types of nodes, usage of various server commands to edit properties of optiSLang project, create and run a new optiSLang project, use an existing optiSLang project, and so on. Every script in this section uses the simple_server.py and registry_query.py module. Each script creates its sample optiSLang project in a directory next to the script. Each script has a corresponding batch file and a shell file that calls the scripts and passes necessary arguments.
You can customize your optiSLang integration by picking different steps from these scripts and combining them to form your own script.
Demo Node Usage
create_sensitivity.py
This script demonstrates how to create an algorithm system with a custom integration node. The Demo integration node is used in this example, which is typically not a part of the optiSLang installation. To extend the scope of optiSLang, see Integration Node. The following tasks are performed in this script:
Assign a project file to the system .
Automatically register parameters and responses by sending a Python script to optiSLang.
Show the node dialog box.
Add criteria.
Add start designs.
Run the system and wait until all the designs are analyzed. This step shows how to get the system status and use it to make the Python script wait until system status is changed.
Go to optiSLang functionality. It launches a ready-made optiSLang project right from your host software. You can also continue to work in the optiSLang application after using the script to create the project.
create_parametric.py
This script is a subset of create_sensitivity.py. This demonstrates how to create a Demo node and receive and send back designs to the project. After the script is completed successfully, the created optiSLang project is launched.
evaluate_designs.py
This script demonstrates how to use an existing project, read its parameters and responses, set new parameters, evaluate designs with the new set of parameter variations and get the results.
This script consists of the SampleIntegration
class that is a reduced
version of Custom
integration. It uses server commands to read
parameters and read responses from the project. The optiSLang project file is passed
as an argument to this script. You can provide variations externally to this script.
Each variation is evaluated and its response is obtained.
Python Node Usage
create_parametric.py
This script creates a Python node and shows you how to provide Python content instead of the project file. You can read and register parameters and responses using this script. You can combine this script with create_sensitivity.py to extend your optiSLang project with the Python node.
Workbench Node Usage
create_parametric.py
This script creates a Workbench node that is connected to the project. This type of node requires you to load the project. On calling the load command, the node is triggered to read the project's parameters and responses. The registration of parameters and responses is different from how it is done in a custom integration node. There are server commands for registration of locations.
You can combine this script with create_sensitivity.py to extend your optiSLang project with the Workbench node.