Skip to main content

ModelCenter Custom Optimization Algorithm SDK 2026 R1

IAlgorithmCatalogEntry Interface

Last update: 19.06.2026

Namespace: Phoenix.Optimization

Overview

Implementations of this interface are designed to allow an IDynamicAlgorithmProvider as well as the rest of the optimization tool to load and work with metadata about an optimization algorithm while avoiding having to actually instantiate or even load the corresponding IAlgorithm implementation.

Inheritance

IAlgorithmCatalogEntry

Declaration

interface IAlgorithmCatalogEntry

Description

Implementations of this interface are designed to allow an IDynamicAlgorithmProvider as well as the rest of the optimization tool to load and work with metadata about an optimization algorithm while avoiding having to actually instantiate or even load the corresponding IAlgorithm implementation.

Public Member Functions

Type Name Description
ISerializableAlgorithm DeserializeAlgorithm (string xml) Given the XML tag for an ISerializableAlgorithm, deserialize the tag and return the result.
void DeserializeAlgorithmToUserInteractionInstance (string xml) Given the XML tag for an ISerializableAlgorithm, deserialize the tag and save it in this instance's UserInteractionInstance.
void DeserializeOptionsToUserInteractionInstance (string innerXML) Given the XML tag for an options object, deserialize the tag to the IAlgorithm.Options property of UserInteractionInstance.
object GetCurrentOptionsForDialog () Returns a clone of the UserInteractionInstance IAlgorithm.Options property for use in the default options dialog.
object GetDefaultOptionsForDialog () Returns a default version of the object this algorithm uses for options.
ISerializableAlgorithm GetOutOfProcessAlgorithm () Create an out-of-process instance of the algorithm suitable for running the algorithm.

Properties

Type Name Description
string Id [get] The ID for this algorithm entry.
IAlgorithm UserInteractionInstance [get] This instance is intended for the Opt Tool to present to the user when configuring the algorithm and optimization tool.

Member Function Documentation

DeserializeAlgorithm

ISerializableAlgorithm DeserializeAlgorithm ( string xml)

Given the XML tag for an ISerializableAlgorithm, deserialize the tag and return the result. Implemented in MockIAlgorithmCatalogEntry.

Parameters:

  • xml -

DeserializeAlgorithmToUserInteractionInstance

void DeserializeAlgorithmToUserInteractionInstance ( string xml)

Given the XML tag for an ISerializableAlgorithm, deserialize the tag and save it in this instance's UserInteractionInstance. Implemented in MockIAlgorithmCatalogEntry.

Parameters:

  • xml - The content of the XML tag.

DeserializeOptionsToUserInteractionInstance

void DeserializeOptionsToUserInteractionInstance ( string innerXML)

Given the XML tag for an options object, deserialize the tag to the IAlgorithm.Options property of UserInteractionInstance. Implemented in MockIAlgorithmCatalogEntry.

Parameters:

  • innerXML - The content of the XML tag.

GetCurrentOptionsForDialog

object GetCurrentOptionsForDialog ( )

Returns a clone of the UserInteractionInstance IAlgorithm.Options property for use in the default options dialog. The UserInteractionInstance should be prepared to accept this object being passed as the value to set the IAlgorithm.Options property, which indicates that the user clicked "OK" and wants to set the modified version of the object. This method may go unimplemented if the algorithm in question supplies a custom options dialog. Throw a NotImplementedException with a message for clarity. Implemented in MockIAlgorithmCatalogEntry.

GetDefaultOptionsForDialog

object GetDefaultOptionsForDialog ( )

Returns a default version of the object this algorithm uses for options. The UserInteractionInstance should be prepared to accept this object being passed as the value to set the IAlgorithm.Options property, which indicates that the user clicked "OK" and wants to set the modified version of the object. This method may go unimplemented if the algorithm in question supplies a custom options dialog. Throw a NotImplementedException with a message for clarity. Implemented in MockIAlgorithmCatalogEntry.

GetOutOfProcessAlgorithm

ISerializableAlgorithm GetOutOfProcessAlgorithm ( )

Create an out-of-process instance of the algorithm suitable for running the algorithm. Before running, the Optimization Tool will set the problem definition and options object currently in use on the UserInteractionInstance. The caller of this method owns the returned IAlgorithm and is responsible for disposing it. Implemented in MockIAlgorithmCatalogEntry.

Returns:

  • An instance of the algorithm suitable for running it out of process.

Id

string Id

The ID for this algorithm entry. This is sometimes used to relocate an algorithm in the overall catalog. This property should be the same as the key associated with this entry in the dictionary returned by IDynamicAlgorithmProvider.LoadAlgorithms. Implemented in MockIAlgorithmCatalogEntry.

UserInteractionInstance

IAlgorithm UserInteractionInstance

This instance is intended for the Opt Tool to present to the user when configuring the algorithm and optimization tool. The instance is owned by the catalog entry and should be disposed when it is disposed. Implemented in MockIAlgorithmCatalogEntry.

Property Documentation

Id

string Id

The ID for this algorithm entry. This is sometimes used to relocate an algorithm in the overall catalog. This property should be the same as the key associated with this entry in the dictionary returned by IDynamicAlgorithmProvider.LoadAlgorithms. Implemented in MockIAlgorithmCatalogEntry.

UserInteractionInstance

IAlgorithm UserInteractionInstance

This instance is intended for the Opt Tool to present to the user when configuring the algorithm and optimization tool. The instance is owned by the catalog entry and should be disposed when it is disposed. Implemented in MockIAlgorithmCatalogEntry.

Connect with Ansys