Skip to main content

ModelCenter Custom Optimization Algorithm SDK 2026 R1

`MockAlgorithm` Class

Last update: 19.06.2026

Namespace: Phoenix.Optimization.AlgorithmTests.MockObjects

Overview

Dummy implementation of T:Phoenix.Optimization.IAlgorithm

Inheritance

MockAlgorithm

Declaration

class `MockAlgorithm`

Description

Dummy implementation of T:Phoenix.Optimization.IAlgorithm

Public Member Functions

Type Name Description
void Dispose () Disposes of the resources (other than memory) used by the MockAlgorithm.
void FromXml (string xml) TODO
List< OptConstraint > GetConstraints () Gets current list of constraints
List< DesignVariable > GetDesignVariables () Gets current list of designVariables
List< Objective > GetObjectives () Gets current list of objectives
XmlSchema GetSchema ()
MockAlgorithm () Initializes a new instance of the MockAlgorithm class.
MockAlgorithm (IAlgorithm algorithm) Initializes a new instance of the MockAlgorithm class with the same properties as the given T:Phoenix.Optimization.IAlgorithm.
void ReadXml (XmlReader reader)
void RestoreCheckPoint (string saveState) RestoreCheckPoint (not implemented)
void Run () Run
void SetConstraints (List< OptConstraint > constraints) SetConstraints
void SetDesignVariableException (Exception exceptionToThrow) Sets an exception to be thrown when call the SetDesignVariables method Setting this to null will ensure that no exception is thrown
void SetDesignVariables (List< DesignVariable > designVariables) SetDesignVariables
void SetHost (IAlgorithmHost host) SetHost
void SetObjectives (List< Objective > objectives) SetObjectives
bool ShowOptionsDialog (IWin32Window owner) ShowOptionsDialog (not implemented)
string ToXml () TODO
void WriteXml (XmlWriter writer)
void FromXml (string xml) TODO
string ToXml () TODO
void RestoreCheckPoint (string saveState) Restore a specific state of the analysis.
void Run () Initiates execution of the solver.
void SetConstraints (List< OptConstraint > constraints) Used by the infrastructure to pass the constraints to the algorithm.
void SetDesignVariables (List< DesignVariable > designVariables) Used by the infrastructure to pass the design variables to the algorithm.
void SetHost (IAlgorithmHost host) Set the host interface to be used for callbacks.
void SetObjectives (List< Objective > objectives) Used by the infrastructure to pass the objectives to the algorithm.
bool ShowOptionsDialog (IWin32Window owner) Called to display the algorithms custom options form.

Properties

Type Name Description
string Author [get] Author
string Description [get] Desciption (not implemented)
string DetailsReport [get] DetailsReport
string HelpFilePath [get] HelpFilePath (not implemented)
string HelpURL [get] HelpURL (not implemented)
string IconLocation [get] IconLocation (not implemented)
string Id [get] A unique string to identify this algorithm.
string Keywords [get] Keywords (not implemented)
string LicenseFeature [get, set] LicenseFeature
int MaxNumberOfObjectives [get, set] MaxNumberOfObjectives
string Name [get, set] Name
AlgorithmNumModelEvaluations NumModelEvaluations [get, set] NumModelEvaluations
object Options [get, set] Options
string ReleaseDate [get, set] ReleaseDate
bool RequiresProxy [get, set] Indicates if ProxiedAlgorithm should wrap this upon deserialization.
string ResultsReport [get] ResultsReport
FuzzyBoolean SupportsConstraints [get, set] SupportsConstraints
FuzzyBoolean SupportsDiscreteVariables [get, set] SupportsDiscreteVariables
bool SupportsFailedRuns [get, set] SupportsFailedRuns
FuzzyBoolean SupportsMinMax [get, set] SupportsMinMax
bool SupportsMultipleObjectives [get, set] SupportsMultipleObjectives
FuzzyBoolean SupportsNonSmoothResponses [get, set] SupportsNonSmoothResponses
FuzzyBoolean SupportsSolveFor [get, set] SupportsSolveFor
string Version [get] Version (not implemented)
WarmStartMethod WarmStartMethod = WarmStartMethod.AlgorithmControlled [get, set] The method used to warm-start this algorithm.

Properties inherited from ISerializableAlgorithm

Type Name Description
string Id [get] A unique string to identify this algorithm.
bool RequiresProxy [get, set] Indicates if ProxiedAlgorithm should wrap this upon deserialization.

Properties inherited from IAlgorithm

Type Name Description
string Author [get] String containing the author of the algorithm.
string Description [get] String containing the description of the algorithm.
string DetailsReport [get] String containing the details report for the problem.
string HelpFilePath [get] String containing the relative path to the algorithm's help file.
string HelpURL [get] String containing a URL that can be used get further help with the algorithm.
string IconLocation [get] String containing the relative path to the algorithm's icon.
string Keywords [get] String containing the keywords associated with the algorithm.
string LicenseFeature [get] String containing the algorithms FlexLM license feature.
int MaxNumberOfObjectives [get] Integer containing the maximum number of objectives supported by the algorithm.
string Name [get] String containing the name of the algorithm.
AlgorithmNumModelEvaluations NumModelEvaluations [get] AlgorithmNumModelEvaluations indicating how many model evaluations are required for convergence.
object Options [get, set] Object containing the options for the algorithm.
string ReleaseDate [get] String containing the release date for the algorithm in the format YYYY.MMDD
string ResultsReport [get] String containing the results report for the problem.
FuzzyBoolean SupportsConstraints [get] FuzzyBoolean stating whether the algorithm supports constraints.
FuzzyBoolean SupportsDiscreteVariables [get] FuzzyBoolean stating whether the algorithm supports discrete variables.
bool SupportsFailedRuns [get] Boolean stating whether the algorithm is able to handle failed model evaluations.
FuzzyBoolean SupportsMinMax [get] FuzzyBoolean stating whether the algorithm supports minimize and maximize objectives.
bool SupportsMultipleObjectives [get] Boolean stating whether or not the algorithm supports multiple objectives.
FuzzyBoolean SupportsNonSmoothResponses [get] FuzzyBoolean stating whether the algorithm supports non-smooth responses (objectives and constraints).
FuzzyBoolean SupportsSolveFor [get] FuzzyBoolean stating whether the algorithm supports the solve for value objective.
string Version [get] String containing the version of the algorithm.

Properties inherited from IWarmStartAlgorithm

Type Name Description
WarmStartMethod WarmStartMethod [get] The method used to warm-start this algorithm.

Constructor & Destructor Documentation

MockAlgorithm()

MockAlgorithm ( )

Initializes a new instance of the MockAlgorithm class.

MockAlgorithm()

MockAlgorithm ( IAlgorithm algorithm)

Initializes a new instance of the MockAlgorithm class with the same properties as the given T:Phoenix.Optimization.IAlgorithm.

Parameters:

  • algorithm - The T:Phoenix.Optimization.IAlgorithm whose properties should be copied.

Member Function Documentation

Dispose

void Dispose ( )

Disposes of the resources (other than memory) used by the MockAlgorithm.

FromXml

void FromXml ( string xml)

Implements ISerializableAlgorithm.

GetConstraints

List< OptConstraint > GetConstraints ( )

Gets current list of constraints

GetDesignVariables

List< DesignVariable > GetDesignVariables ( )

Gets current list of designVariables

GetObjectives

List< Objective > GetObjectives ( )

Gets current list of objectives

Returns:

  • Current list of objectives

RestoreCheckPoint

void RestoreCheckPoint ( string saveState)

RestoreCheckPoint (not implemented)

Parameters:

  • saveState - Save state.

Implements IAlgorithm.

Run

void Run ( )

Run Uses values set in the Options to update properties

Implements IAlgorithm.

SetConstraints

void SetConstraints ( List< OptConstraint > constraints)

SetConstraints

Parameters:

  • constraints - Constraints

Implements IAlgorithm.

SetDesignVariableException

void SetDesignVariableException ( Exception exceptionToThrow)

Sets an exception to be thrown when call the SetDesignVariables method. Setting this to null will ensure that no exception is thrown

Parameters:

  • exceptionToThrow - The exception to throw when calling. See alsoSetDesignVariables

SetDesignVariables

void SetDesignVariables ( List< DesignVariable > designVariables)

SetDesignVariables

Parameters:

  • designVariables - Design Variables

Implements IAlgorithm.

SetHost

void SetHost ( [IAlgorithmHost]() host)

SetHost

Parameters:

  • host - Algorithm host

Implements IAlgorithm.

SetObjectives

void SetObjectives ( List< Objective > objectives)

SetObjectives

Parameters:

  • objectives - Objectives

Implements IAlgorithm.

ShowOptionsDialog

bool ShowOptionsDialog ( IWin32Window owner)

ShowOptionsDialog (not implemented)

Parameters:

  • owner - Parent for options dialog.

Returns:

  • Returns true if the options dialog was handled by the algorithm; false otherwise.

Implements IAlgorithm.

ToXml

string ToXml ( )

Implements ISerializableAlgorithm.

Property Documentation

Author

string Author

Author

Implements IAlgorithm.

Description

string Description

Description (not implemented)

Implements IAlgorithm.

DetailsReport

string DetailsReport

DetailsReport

Implements IAlgorithm.

HelpFilePath

string HelpFilePath

HelpFilePath (not implemented)

Implements IAlgorithm.

HelpURL

string HelpURL

HelpURL (not implemented)

Implements IAlgorithm.

IconLocation

string IconLocation

IconLocation (not implemented)

Implements IAlgorithm.

Id

string Id

A unique string to identify this algorithm.

Implements ISerializableAlgorithm.

Keywords

string Keywords

Keywords (not implemented)

Implements IAlgorithm.

LicenseFeature

string LicenseFeature

LicenseFeature. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

MaxNumberOfObjectives

int MaxNumberOfObjectives

MaxNumberOfObjectives. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

Name

string Name

Name. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

NumModelEvaluations

AlgorithmNumModelEvaluations NumModelEvaluations

NumModelEvaluations. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

Options

object Options

Options This will return an empty object if it has not been set previously as opposed to null

Implements IAlgorithm.

ReleaseDate

string ReleaseDate

ReleaseDate. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

RequiresProxy

bool RequiresProxy

Indicates if ProxiedAlgorithm should wrap this upon deserialization.

Implements ISerializableAlgorithm.

ResultsReport

string ResultsReport

ResultsReport

Implements IAlgorithm.

SupportsConstraints

FuzzyBoolean SupportsConstraints

SupportsConstraints. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsDiscreteVariables

FuzzyBoolean SupportsDiscreteVariables

SupportsDiscreteVariables. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsFailedRuns

bool SupportsFailedRuns

SupportsFailedRuns. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsMinMax

FuzzyBoolean SupportsMinMax

SupportsMinMax. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsMultipleObjectives

bool SupportsMultipleObjectives

SupportsMultipleObjectives. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsNonSmoothResponses

FuzzyBoolean SupportsNonSmoothResponses

SupportsNonSmoothResponses. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

SupportsSolveFor

FuzzyBoolean SupportsSolveFor

SupportsSolveFor. This property is writable for T:Phoenix.Optimization.AlgorithmTests.MockObjects.MockAlgorithm

Implements IAlgorithm.

Version

string Version

Version (not implemented)

Implements IAlgorithm.

WarmStartMethod

WarmStartMethod WarmStartMethod = WarmStartMethod.AlgorithmControlled

The method used to warm-start this algorithm.

Implements IWarmStartAlgorithm.

Connect with Ansys