optiSLang provides various Python modules that can be used to extend functionality. Python examples can be found here.
This documentation provides an overview of the optiSLang Python API. This API can be used to create and modify optiSLang projects using Python scripting as well as to customize certain optiSLang functionality.
Modules
You can display detailed help for each module by using the help
command
with the module as parameter after importing it into the Python console. For
example:
> import PyOptimizerBase > import PyNOA > help(PyNOA)
A list of available classes and functions is displayed in the Python console.
Python Module | Description |
---|---|
Data types | |
id | Provides helper classes to access objects in optiSLang. |
py_algorithm_info | Provides information about algorithms used in optiSLang Monitoring Databases (omdb). |
py_omdb | Provides functions to handle omdb files. |
py_os_criterion | Defines criteria as objectives, constraints or limit state functions. |
py_os_design | Provides functions to modify or export designs or to extract design information. |
py_os_parameter | Provides functions to create a parameter manager. |
py_random_variables | Provides types to define random variables. |
py_transform | Provides transformation functions. |
pyvariant | Uses the Variant data type. |
stdcpp_python_export | Uses some general data types (vectors, lists or sets of strings, doubles or ints). |
Kernel (imported by default) | |
_optiSLang_Actors | Provides available optiSLang actors. |
_optiSLang_Kernel | Provides systems and functions to create simulation chains. |
Postprocessing | |
py_monitoring_gui | Contains classes to control visuals in postprocessing. |
py_monitoring_kernel | Provides functions to handle monitoring data. |
py_osl3binfile | Provides methods to write a binfile using parameter manager and designs. |
Algorithms | |
dynardo_py_algorithms | Defiines algorithm enums (DOETYPES, DeterministicType, ParameterType, RandomVariableKind, RandomVariableType) and types (DeterministicTypeVec, bitset_type, matrix_type, vector_type). |
os_doe_py_export | Provides methods for Design of Experiments (DOE). |
py_doe_settings | Defines settings for DOE caclulations. |
PyARSM | Provides settings and methods for the Approximation of Response Surface Method. |
PyMemetic | Provides settings and methods for the Memetic algorithm. |
PyNLPQLP | Provides settings and functions for the NLPQL algorithm. |
PyNOA | Provides settings and methods for nature-inspired optimization algorithms. |
PyOptimizerBase | Acts as the base class for optimization algorithms to set common objects as bounds and start designs. |
PySimplex | Provides settings and methods for the Simplex algorithm. |
reliability | Provides settings and methods for reliability algorithms. |
Project | |
py_project | Provides functions to modify or to extract project information. |
Actors
You can display detailed help for all actors by using the help(actors)
command in the Python console. You can display detailed help for a single actor by using
the help(actors.actorname)
command. For example:
help(actors.SensitivityActor)
The actor class is the base class for all of the following nodes and systems. You can adding input and output slots here, and use Set and Get functionality for special properties for each derived actor.
Enums | |
Defines when to write a binfile. AT_THE_END = _optiSLang_Actors.UpdateBinFileInterval.AT_THE_END EVERY_DESIGN = _optiSLang_Actors.UpdateBinFileInterval.EVERY_DESIGN EVERY_ITERATION = _optiSLang_Actors.UpdateBinFileInterval.EVERY_ITERATION NEVER = _optiSLang_Actors.UpdateBinFileInterval.NEVER | |
Nodes | |
Define outputs using mathematical expressions. | |
DistinctWorkingDirActor |
The following nodes are derived from DistinctWorkingDirActor.
|
Sequencing Systems
For a detailed list of available methods see
| |
This actor class is the base of all algorithm actors (systems). Parameter, criteria, results, start designs and designs are managed here. | |
AlgorithmSystemActor |
This class offers functionality for binfile writing. Algorithm settings can be modified using the set functionality of specific algorithm actors.
SamplingActor |