*_ca.py or *_algo.py and should be placed in any of the following locations:
[installation path]/scripting/algorithmns- Directories specified by configuration settings.
- Directories specified by the environment variable
OSL_ALT_CA_SEARCH_DIRS, separated by the native environment separator (;on Windows or:on Linux).
- Node icon (
.svg, .jpg, .png, .jpeg, .ico, .bmp) - Documentation page in the help system (
.html) - Configuration (
.cfg) - Algorithm settings user interface declaration file (
.qml)
GetMaxNumberOfDesigns(kwargs)
Returns the maximum number of design evaluations requested by the algorithm before termination.
- Inputs:
settings: PyOSDesignPoint with algorithm settings. Access input usingkwargs["settings"].
- Outputs:
- unsigned int: Maximum number of expected design evaluations.
InitializeAlgorithm(args)
Initializes the algorithm with the input values.
- Inputs:
parameters: PyParameterManager with parametrizationstart designs: PyOSDesignContainer with start designsresponses: PyOSDesignPoint with defined responsescriteria: PyOSCriterionContainer with defined criteriaseed: integer with seed usedsettings: PyOSDesignPoint with algorithm settingsPyOSDesignPoint- optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). DeprecatedOSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: is empty unless a specific version is used
- Outputs:
- bool: Success value of the initialization
GetNextDesigns(args)
Returns the next designs that must be calculated by the solver.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). DeprecatedOSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
next designs: PyOSDesignContainer with expected designs
SetResults(args)
Sets the results calculated by the solver.
- Inputs:
designs: PyOSDesignContainer with expected designs including calculated responsesPyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Success value of the function
Appraise(args)
Appraises the last set results.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Success value of the function (not the appraisal itself)
Adapt(args)
Adapts the next designs expected to be calculated by the solver.
- Inputs:
parameters: PyParameterManager with parametrizationstart designs: PyOSDesignContainer with start designsresponses: PyOSDesignPoint with defined responsescriteria: PyOSCriterionContainer with defined criteriaseed: integer with seed used by optiSLangsettings: PyOSDesignPoint with algorithm settingsPyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Success value of the adaption
IsTerminated(args)
Decides if the algorithm is terminated.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Termination state
IsConverged(args)
Decides if the algorithm is converged.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Convergency state
GetSettings(args)
Returns the internally used algorithm settings to show them in the dialog.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- list (PyOSDesignPoint): Internal settings (name and value pairs)
CheckSettings(args)
Checks the internally used algorithm settings.
- Inputs:
PyOSDesignPoint: Algorithm settingsPyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
- bool: Success value of the check
IsOptimization(args)
Decides if the algorithm uses optimization parameters.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
bool- which istrueif the algorithm uses optimization parameters
IsStochastic(args)
Decides if the algorithm uses stochastic parameters.
- Inputs:
PyOSDesignPoint: optiSLang variables:OSL_PROJECT_WORKING_DIR- Absolute path of the current project (*.opd).OSL_PROJECT_FILE_DIR- Absolute path of the current directory containing the project file (*.opf).OSL_PROJECT_DIR: absolute path of the current project (*.opd). Deprecated.OSL_WORKING_DIR: absolute path of the current working directoryOSL_CUSTOM_SCRIPT_DIR: absolute path of the current script fileOSL_RLS_VER: version numberOSL_RLS_REV: revision numberOSL_RLS_FLG: empty unless a specific version is used
- Outputs:
bool- which istrueif the algorithm uses stochastic parameters
