About the Approximation Component API

The Approximation component provides an API for programmatically configuring various options from a Java program or script.

For information about component APIs, see Component APIs.

The Approximation component API consists of the following methods:

  • getString("ApproximationTechniqueName"), set("ApproximationTechniqueName", metaModelName). You can use these methods to get/set the approximation technique used by the Approximation component. The metamodel name must be one of the following strings: "com.engineous.plugin.approx.RSM", "com.engineous.plugin.approx.RBF", "com.engineous.plugin.approx.orthopoly", "com.engineous.plugin.approx.kriging".

  • getInt("DataFileType"), set("DataFileType", dataFileTypeCode). You can use these methods to get/set the data file type used by the Approximation component. The value of dataFileTypeCode must be 1 (data file with Sampling Points) or 3 (data file with previously saved Coefficients Data).

  • getString("DataFileFullPathName"), set("DataFileFullPathName", dataFileFullPathName). You can use these methods to get/set the path name of the data file used by the Approximation component. The value of dataFileFullPathName must point to a file on the disk.

  • getInt("DataFileStorageType"), set("DataFileStorageType", dataFileStorageTypeCode). You can use these methods to get/set the storage type of the data file used by the Approximation component. The value of dataFileStorageTypeCode must be one of the following: 0 for static storage (data file is saved in model immediately and not updated before initialization), 1 for dynamic storage (data file is read from the specified name path on the disk before initialization), or 2 for file parameter storage (a file parameter is created on the Approximation component and can be mapped to receive data from another component at run time).

  • get("ApproximationTechniqueOption", optionName), set("ApproximationTechniqueOption", optionName, optionValue). You can use these methods to get/set the values of technique-specific options used by the Approximation component (see the tables below).

    Response Surface Model Approximation Technique API Options

    optionName

    optionValue data type

    optionValue possible values

    PolynomialOrder

    Integer

    0 – Linear polynomial

    1 – Quadratic polynomial

    2 – Cubic polynomial

    3 – Quartic polynomial

    TermSelectionMethod

    Integer

    -1 – No term selection

    0 – Sequential method

    1 – Stepwise method

    2 – Two-at-a-time method

    3 – Exhaustive search method

    TermsToSelect

    Integer

    From 1 to maximum number of polynomial terms

    RBF Model Approximation Technique API Options

    optionName

    optionValue data type

    optionValue possible values

    Smoothing Filter

    Double

    From 0.0 to 0.1

    FitType

    String

    Radial

    Elliptical

    MaxEBFIters

    Integer

    Greater than 1

    Kriging Model Approximation Technique API Options

    optionName

    optionValue data type

    optionValue possible values

    FitType

    String

    ISOTROPIC

    ANISOTROPIC

    CorrelationType

    String

    EXPONENTIAL

    GAUSSIAN

    MATERN _LINEAR

    MATERN_CUBIC

    FilterDistance

    Double

    From 0.0 to 1.0

    MaxOptIters

    Integer

    Greater than 1

    Orthogonal Polynomial Model Approximation Technique API Options

    optionName

    optionValue data type

    optionValue possible values

    UseChebyshev

    String

    "true" – Creates a Chebyshev Polynomial approximation

    "false" – Creates a Successive Orthogonal Polynomial approximation

    Degree

    Integer

    Greater than or equal to 1

    IncludeCrossterms

    String

    "true" – Includes cross terms in the model

    "false" – Does not include cross terms in the model

  • get("ApproximationTechniqueOptionNames"). You can use this method to get a list of all option names of the approximation technique used by the Approximation component. The option names for all approximation techniques installed by default with Isight are listed in the tables above. The return value of the method is a Java object of type java.util.Collection containing string objects, one for each option name.

  • getInt("ErrorAnalysisType"), set("ErrorAnalysisType", errorAnalysisTypeCode). You can use these methods to get/set the error analysis type used by the Approximation component. The value of errorAnalysisTypeCode must be one of the following: 1 – standard error analysis using additional data points, 2 – cross-validation error analysis type, or 3 – no error analysis.

  • getString("ErrorAnalysisDataFileFullPathName"), set("ErrorAnalysisDataFileFullPathName", errorAnalsysisDataFileFullPathName). You can use these methods to get/set the path name of the data file used for the error analysis by the Approximation component. The value of errorAnalsysisDataFileFullPathName must point to a file on the disk.

  • getInt("ErrorAnalysisDataFileStorageType"), set("ErrorAnalysisDataFileStorageType", errorAnalysisDataFileStorageTypeCode). You can use these methods to get/set the storage type of the error analysis data file used by the Approximation component. The value of errorAnalysisDataFileStorageTypeCode must be one of the following: 0 for static storage (data file is saved in model immediately and not updated before initialization), or 1 for dynamic storage (data file is read from the specified name path on the disk before initialization).

  • getInt("NumCrossValidationPoints"), set ("NumCrossValidationPoints", numPoints). You can use these methods to get/set the number of cross-validation points used by the Approximation component during error analysis. The numPoints argument must be an integer value.

  • getLong("CrossValidationRandomSeed"), set ("CrossvalidationRandomSeed", seedValue). You can use these methods to get/set the random generator seed value for selecting cross-validation points used by the Approximation component during error analysis. The seedValue argument must be a long value.

  • get("InputParameterNames"), set("InputParameterNames", inputNames). You can use these methods to get/set the input parameters used by the Approximation component. The inputNames argument must be a String[] array of existing input parameter names.

  • get("OutputParameterNames"), set("OutputParameterNames", outputNames). You can use these methods to get/set the output parameters used by the Approximation component. The outputNames argument must be a String[] array of existing output parameter names.

  • call("initializeApproximation"). You can use this method to invoke initialization of the Approximation component. If an error analysis type was configured for the approximation, the error analysis will be performed as the last part of the initialization.

  • get("InitializationDataPoints"). You can use this method to get all initialization data points of the Approximation component. The Approximation component must be initialized before calling this API. The return value of the method is a Java double[] [] array (matrix), where each row of the matrix corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first, then outputs.

  • call("exportInitializationDataPoints", dataFileFullPathName). You can use this method to export the initialization data points of the Approximation component to a local file. The Approximation component must be initialized. The data points are written to the specified file as a table of values; each row of the table corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first; then outputs.

  • call("exportCoefficientsData", outputFileName). You can use this method to invoke the Approximation component export function. Coefficient data are written to the specified output file. The Approximation component must be initialized before calling this API.

  • call("evaluate", inputParameterValues). You can use this method to invoke the Approximation component evaluation function. The Approximation component must be initialized before calling this API. The argument is a double[] array of input values in the same order as the input parameter names. The return value is a double[] array of the output values in the same order as the output parameter names.

  • call("executeErrorAnalysis"). You can use this method to invoke the error analysis of the Approximation component. Typically, this method is not needed if the approximation was initialized by the call("evaluate", inputParameterValues)API method because the error analysis would have been performed already. The Approximation component must be initialized before calling this API.

  • get("ErrorAnalysisExactDataPoints"). You can use this method to get the exact data points used for error analysis of the Approximation component. The Approximation component must be initialized and have error analysis executed before calling this API. The return value for the method is a Java double[] [] array (matrix), where each row of the matrix corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first, then outputs.

  • get("ErrorAnalysisPredictedDataPoints"). You can use this method to get the predicted data points (output values calculated by the approximation itself) used for error analysis of the Approximation component. The Approximation component must be initialized and have error analysis executed before calling this API. The return value of the method is a Java double[] [] array (matrix), where each row of the matrix corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first, then outputs.

  • call("exportErrorAnalysisExactDataPoints", dataFileFullPathName). You can use this method to export the exact data points used for error analysis of the Approximation component to a local file. The Approximation component must be initialized and have error analysis executed before calling this API. The data points are written to the specified file as a table of values; each row of the table corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first, then outputs.

  • call("exportErrorAnalysisPredictedDataPoints", dataFileFullPathName). You can use this method to export the predicted data points (output values calculated by the approximation itself) used for error analysis of the Approximation component to a local file. The Approximation component must be initialized and have error analysis executed before calling this API. The data points are written to the specified file as a table of values; each row of the table corresponds to one data point, and each column corresponds to one parameter. The order of the columns is inputs first, then outputs.

  • get("ErrorAnalysisData", outputName). You can use this method to get error analysis data for one output parameter produced during error analysis of the Approximation component. The Approximation component must be initialized and have error analysis executed before calling this API. The return value of the method is a Java double[] [] array (matrix) with two columns. Each row of the matrix corresponds to one data point; the first column is the exact value of the output, and the second column is the predicted (approximate) value of the output. Error data in this format can be used for creating actual versus predicted graphs.

  • get("ErrorAnalysisData"). You can use this method to get all error analysis data for all output parameters produced during error analysis of the Approximation component. The Approximation component must be initialized and have error analysis executed before calling this API. The return value for the method is a Java object of type java.util.HashMap<String,double[] []> where the keys are output parameter names, and values are double[] [] arrays (matrices) with two columns. Each row of each matrix corresponds to one data point; the first column is the exact value of the output, and the second column is the predicted (approximate) value of the output. Error data in this format can be used for creating actual versus predicted graphs.