Difference between revisions of "CModel Constructors"

From ReliaWiki
Jump to navigation Jump to search
Line 1: Line 1:
{{Template:APIClass|cModel_Class|cModel}}{{DISPLAYTITLE:cModel Constructors}}
+
{{DISPLAYTITLE:cModel Constructors}}{{Template:API}}{{Template:APIBreadcrumb|9|.[[Cmodel Class|cModel]]}}
Constructors for the [[cModel_Class|cModel]] class.
+
 
 +
 
 +
<onlyinclude>A parameterized constructor for the [[CModel Class|cModel]] class.</onlyinclude>
  
 
== Syntax ==
 
== Syntax ==
*cModel()                                                 {{APIComment|{{Template:cModel_Constructors1.Cmt}}}}
+
'''cModel'''(''ModelType'', ''ModelCategory'', ''ModelName'', ''ModelParams()'')
*cModel( ModelType{{APIPrefix|As ModelTypeEnum}}, ModelCategory {{APIPrefix|As ModelCategoryEnum}}, ModelName {{APIPrefix|As String}},{{APIPrefix|ParamArray}} ModelParams(){{APIPrefix|As Double}})                    {{APIComment|{{Template:cModel_Constructors2.Cmt}}}}
+
 
 +
===Parameters===
 +
''ModelType''
 +
: The type of model (e.g., 2-parameter Weibull), specified with a [[ModelTypeEnum Enumeration|ModelTypeEnum]] enumeration value. (Note that some models cannot be created through the API.)
 +
''ModelCategory''
 +
: The model category (e.g., reliability model), specified with a [[ModelCategoryEnum Enumeration|ModelCategoryEnum]] enumeration value.
 +
''ModelName''
 +
: String. The model name.
 +
''ModelParams()''
 +
: Double. An array of parameter values. <!--Need to create/link page explaining how the values should be ordered, depending on distribution.-->
  
Parameters
+
== Example ==
:''ModelType'': The type of model (e.g., 2-parameter Weibull), specified with a ModelTypeEnum enumeration value. Note that some models cannot be created through the API (i.e., some can be created only within the user interface of a Synthesis application). See [[ModelTypeEnum Enumeration|ModelTypeEnum]].
+
'''VB'''
:''ModelCategory'': The model category (e.g., reliability model), specified with a [[ModelCategoryEnum Enumeration|ModelCategoryEnum]] value.
+
:''ModelName'': The model name.
+
{{APIComment|'Declare the cModel class using a pre-defined parameter list.}}
:''ModelParams()'': An array of parameter values. <!--Need to create/link page explaining how the values should be ordered, depending on distribution.-->
+
  {{APIPrefix|Dim}} newParams(1) {{APIPrefix|As Double}}
 +
  newParams(0) = 1
 +
  newParams(1) = 100
 +
  {{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.}}
 +
  {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum_Weibull2, ModelCategoryEnum_Reliability, {{APIString|"NewModel1"}}, 1, 100)
  
== Usage Example ==
+
'''VB.NET'''
 
  {{APIComment|'Declare the cModel class using a pre-defined parameter list.}}
 
  {{APIComment|'Declare the cModel class using a pre-defined parameter list.}}
   Dim newParams(1) As Double
+
   {{APIPrefix|Dim}} newParams(1) {{APIPrefix|As Double}}
 
   newParams(0) = 1
 
   newParams(0) = 1
 
   newParams(1) = 100
 
   newParams(1) = 100
   Dim newModel As New cModel(ModelTypeEnum.Weibull2,  
+
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, newParams)
    ModelCategoryEnum.Reliability, "NewModel1", newParams)
 
 
    
 
    
 
  {{APIComment|'Alternatively, declare the cModel class using an in-line parameter list.}}
 
  {{APIComment|'Alternatively, declare the cModel class using an in-line parameter list.}}
   Dim newModel As New cModel(ModelTypeEnum.Weibull2,  
+
   {{APIPrefix|Dim}} newModel {{APIPrefix|As New}} cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, {{APIString|"NewModel1"}}, 1, 100)
    ModelCategoryEnum.Reliability, "NewModel1", 1, 100)
 

Revision as of 21:18, 27 July 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


A parameterized constructor for the cModel class.

Syntax

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

Parameters

ModelType

The type of model (e.g., 2-parameter Weibull), specified with a ModelTypeEnum enumeration value. (Note that some models cannot be created through the API.)

ModelCategory

The model category (e.g., reliability model), specified with a ModelCategoryEnum enumeration value.

ModelName

String. The model name.

ModelParams()

Double. An array of parameter values.

Example

VB

 'Declare the cModel class 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, declare the cModel class using an in-line parameter list. 
 Dim newModel As New cModel(ModelTypeEnum_Weibull2, ModelCategoryEnum_Reliability, "NewModel1", 1, 100)
VB.NET
 'Declare the cModel class 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, declare the cModel class using an in-line parameter list. 
 Dim newModel As New cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, "NewModel1", 1, 100)