CModel Constructors: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
  '''VB.NET'''
  '''VB.NET'''
   
   
  {{APIComment|'Declare the cModel class using a pre-defined parameter list.}}
  {{APIComment|'Create a new model using a pre-defined parameter list.}}
   {{APIPrefix|Dim}} newParams(1) {{APIPrefix|As Double}}
   {{APIPrefix|Dim}} newParams(1) {{APIPrefix|As Double}}
   newParams(0) = 1
   newParams(0) = 1
   newParams(1) = 100
   newParams(1) = 100
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, newParams)
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, newParams)
 
 
  {{APIComment|'Alternatively, declare the cModel class using an in-line parameter list.}}
  {{APIComment|'Alternatively, you can create a new model using an in-line parameter list.}}
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, 1, 100)
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, 1, 100)

Revision as of 18:31, 28 July 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


A parameterized constructor for the cModel class. (VisualBasic.NET only)

Syntax

cModel(ModelType, ModelCategory, ModelName, ModelParams())

Parameters

ModelType

The type of model (e.g., 2-parameter Weibull). Can be any ModelTypeEnum constant. (Required)

ModelCategory

The model category (e.g., reliability model). Can be any ModelCategoryEnum constant. (Required)

ModelName

String. The model name. (Required)

ModelParams()

Double. An array of parameter values. (Required)

Example

VB.NET

 'Create a new model using a pre-defined parameter list. 
 Dim newParams(1) As Double
 newParams(0) = 1
 newParams(1) = 100
 Dim newModel As New cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability, "NewModel1", newParams)
 'Alternatively, you can create a new model using an in-line parameter list. 
 Dim newModel As New cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, "NewModel1", 1, 100)