Python API Documentation

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.

optiSLang Python API Guide

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 ModuleDescription
Data types
idProvides helper classes to access objects in optiSLang.
py_algorithm_infoProvides information about algorithms used in optiSLang Monitoring Databases (omdb).
py_omdbProvides functions to handle omdb files.
py_os_criterionDefines criteria as objectives, constraints or limit state functions.
py_os_designProvides functions to modify or export designs or to extract design information.
py_os_parameterProvides functions to create a parameter manager.
py_random_variablesProvides types to define random variables.
py_transformProvides transformation functions.
pyvariantUses the Variant data type.
stdcpp_python_exportUses some general data types (vectors, lists or sets of strings, doubles or ints).
Kernel (imported by default)
_optiSLang_ActorsProvides available optiSLang actors.
_optiSLang_KernelProvides systems and functions to create simulation chains.
Postprocessing
py_monitoring_guiContains classes to control visuals in postprocessing.
py_monitoring_kernelProvides functions to handle monitoring data.
py_osl3binfileProvides methods to write a binfile using parameter manager and designs.
Algorithms
dynardo_py_algorithmsDefiines algorithm enums (DOETYPES, DeterministicType, ParameterType, RandomVariableKind, RandomVariableType) and types (DeterministicTypeVec, bitset_type, matrix_type, vector_type).
os_doe_py_exportProvides methods for Design of Experiments (DOE).
py_doe_settingsDefines settings for DOE caclulations.
PyARSMProvides settings and methods for the Approximation of Response Surface Method.
PyMemeticProvides settings and methods for the Memetic algorithm.
PyNLPQLPProvides settings and functions for the NLPQL algorithm.
PyNOAProvides settings and methods for nature-inspired optimization algorithms.
PyOptimizerBaseActs as the base class for optimization algorithms to set common objects as bounds and start designs.
PySimplexProvides settings and methods for the Simplex algorithm.
reliabilityProvides settings and methods for reliability algorithms.
Project
py_projectProvides 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

UpdateBinFileInterval

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

CalculatorSetActor

Define outputs using mathematical expressions.

DistinctWorkingDirActor

The following nodes are derived from DistinctWorkingDirActor.

MOPActor

 

PathActor

 

PostprocessingActor

 

VariableActor

 

VariantMonitoringActor

 
Sequencing Systems

For a detailed list of available methods see help(SequencingSystem)

ParametricSystemActor

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.

OptimizationBaseActor

SamplingActor