Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

CreateCustomModelInterface Struct Reference

Last update: 16.07.2025

This class is exported as an director class through SWIG allowing the python context to define derivations from it. A user is then able to implement her own classes satisfying this interface and then being used with the MOP framework. More...

Public Member Functions

virtual string __class_name_internal__ ()
 Internal helper function to use with de-/serialization.
 
virtual bool compute (::data_handler::DataHandlerBase datahandler, TrainingPlanBase training_plan, quality_measure::QualityMeasureBase quality_measure, CustomModel model)
 Trains the model in the goal language and returns a handle to the newly trained model that is used to access the model in the PluginModelManager. More...
 
virtual string displayName ()
 Returns the name to be displayen in all GUI situations Fallback is class name. More...
 
PropertyList getProperties ()
 This function makes the properties set on the C++ CustomModel class accessible to the Python context. More...
 
virtual bool isValid (::data_handler::DataHandlerBase datahandler, TrainingPlanBase training_plan)
 This function is used to check whether the model may be trained or not A python CreateModel... class shall implement this function to let the MOP check if the datahandler and training plan are suitable to actually train the model. More...
 
virtual string licenseLevel ()
 Returns a user definable license level for this CustomModel "Pro", "Premium" (default), "Enterprise". More...
 
virtual bool loadJson (JsonValue root)
 This function is used to read the CreateCustomModels configuration state from the the given string. How this is done needs to be implemented in Python. More...
 
virtual bool saveJson (JsonValue root)
 This function returns the state as a Json from the Python of the CustomModelInterface to be included in the CustomModel. It needs to be overloaded in Python. More...
 

Public Attributes

string nodeName
 
string workingDir
 Access the working directory and the node name from python.
 

Detailed Description

This class is exported as an director class through SWIG allowing the python context to define derivations from it. A user is then able to implement her own classes satisfying this interface and then being used with the MOP framework.

Member Function Documentation

◆ compute()

virtual bool compute ( ::data_handler::DataHandlerBase  datahandler,
TrainingPlanBase  training_plan,
quality_measure::QualityMeasureBase  quality_measure,
CustomModel  model 
)
virtual

Trains the model in the goal language and returns a handle to the newly trained model that is used to access the model in the PluginModelManager.

Parameters
datahandlerThe data to train the model with
training_planThe training plan to use when training the model
quality_measureThe quality measure to evaluate the models prognosis quality with
modelThe custom model that handles/stores the newly created custom model
Returns
true is the CustomModel could be created

◆ displayName()

virtual string displayName ( )
virtual

Returns the name to be displayen in all GUI situations Fallback is class name.

Returns
the display name

◆ getProperties()

PropertyList getProperties ( )

This function makes the properties set on the C++ CustomModel class accessible to the Python context.

Returns
A property list

◆ isValid()

virtual bool isValid ( ::data_handler::DataHandlerBase  datahandler,
TrainingPlanBase  training_plan 
)
virtual

This function is used to check whether the model may be trained or not A python CreateModel... class shall implement this function to let the MOP check if the datahandler and training plan are suitable to actually train the model.

Parameters
datahandlerThe datahandler containing the data for the training
training_planThe training_plan describing how to train the model
Returns
true iff the models training is likely to succeed

◆ licenseLevel()

virtual string licenseLevel ( )
virtual

Returns a user definable license level for this CustomModel "Pro", "Premium" (default), "Enterprise".

Returns
one of these values ("Premium" by default)

◆ loadJson()

virtual bool loadJson ( JsonValue  root)
virtual

This function is used to read the CreateCustomModels configuration state from the the given string. How this is done needs to be implemented in Python.

Parameters
stateThe Json string as produced by the saveJson function
Returns
True iff loading the state was successful

◆ saveJson()

virtual bool saveJson ( JsonValue  root)
virtual

This function returns the state as a Json from the Python of the CustomModelInterface to be included in the CustomModel. It needs to be overloaded in Python.

Returns
The serialization of the python instance

Connect with Ansys