Documentation

sdo.EvaluateOptions class

Package: sdo

Cost function evaluation options for sdo.evaluate

Syntax

opt = sdo.EvaluateOptions
opt = sdo.EvaluateOptions(Name,Value)

Description

Specify options such as evaluation error handling, display settings, and the use of parallel computing for cost function evaluations using sdo.evaluate.

Construction

opt = sdo.EvaluateOptions creates an sdo.EvaluateOptions object and assigns default values to the properties.

opt = sdo.EvaluateOptions(Name,Value) creates an sdo.EvaluateOptions object with additional options specified by one or more Name,Value pair arguments. Name is a property name and Value is the corresponding value.

Input Arguments

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify properties of sdo.EvaluateOptions object during object creation. For example, opt = sdo.EvaluateOptions('Display','off') creates a sdo.EvaluateOptions object specifying the Display property as off.

Properties

expand all

Parallel computing option for sdo.evaluate, specified as one of the following:

  • false or 0 — Do not use parallel computing during cost function evaluation.

  • true or 1 — Use parallel computing during cost function evaluation.

    It is recommended that you also specify values for the EvaluatedModel, and ParallelFileDependencies, or ParallelPathDependencies properties, if needed.

Parallel Computing Toolbox™ software must be installed to enable parallel computing for the cost function evaluation.

Handling of cost function evaluation error, specified as one of the following values:

  • 'on'sdo.evaluate stops when a cost function evaluation results in an error.

  • 'off'sdo.evaluate continues when a cost function evaluation results in an error. sdo.evaluate returns the error using the info output argument.

Viewing of display messages for cost function evaluations, specified as one of the following values:

  • 'final' — Display only the final output.

  • 'off' — Display no output.

  • 'iter' — Display the output for each evaluation.

File dependencies to use during parallel evaluation, specified as a cell array of character vectors. Each character vector can specify either an absolute or relative path to a file. For example, {'C:\matlab\work\file1.m','C:\matlab\myProject\file2.m'}. These files are copied to the workers during parallel evaluation. Use sdo.getModelDependencies to find the dependencies of a Simulink® model.

Paths to dependencies to use during parallel evaluation, specified as a cell array of character vectors. For example, {'C:\matlab\work','C:\matlab\myProject'}. These path dependencies are temporarily added to the workers during parallel evaluation. Use sdo.getModelDependencies to find the dependencies of a Simulink model.

Name of Simulink model to be evaluated, specified as a character vector. For example, 'sldo_model1'.

This property is used to configure the model for parallel evaluation (UseParallel = true).

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).

Examples

expand all

Create an sdo.EvaluateOptions object.

opt = sdo.EvaluateOptions;

Specify handling of cost function evaluation error.

opt.StopOnEvaluateError = 'on';

Create an sdo.EvaluateOptions object to view output for each evaluation.

opt = sdo.EvaluateOptions('Display','iter');
Was this topic helpful?