Optimizer settings#

This example demonstrates how to create and configure optimizer systems.

It uses the optimizer_settings.py file to create, configure, and insert an EA (Evolutionary Algorithm) optimizer into the scenery. It then explains how you can optionally save a copy of the project to a desired location.

# Perform required imports
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Create optiSLang instance#

Create the optiSLang instance.

osl = Optislang()

Get path of example script and run it#

Get the path of the example script and then run this script.

paths = examples.get_files("optimizer_settings")

Optionally save project#

If you want to save the project to some desired location, uncomment and edit these lines:

path = r'<insert-desired-location>'
osl.save_as(os.path.join(path, "test_project.opf"))

Stop and cancel project#

Stop and cancel the project.


View generated workflow#

This image shows the generated workflow.

Result of script.

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery