CModel Constructors: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
===Parameters===
===Parameters===
''ModelType''
''ModelType''
:Required. The type of model (e.g., 2-parameter Weibull). Can be any [[ModelTypeEnum Enumeration|ModelTypeEnum]] constant.
:Required. The type of model (e.g., 2-parameter Weibull). Can be any of the model types listed in the table below. These constants are obtained from the [[ModelTypeEnum Enumeration|ModelTypeEnum]].
''ModelCategory''
''ModelCategory''
:Required. The model category (e.g., reliability model). Can be any [[ModelCategoryEnum Enumeration|ModelCategoryEnum]] constant.
:Required. The model category (e.g., reliability model). Can be any [[ModelCategoryEnum Enumeration|ModelCategoryEnum]] constant.
Line 16: Line 16:
''ModelParams()''
''ModelParams()''
:Required. Double. An array of the model's parameters.
:Required. Double. An array of the model's parameters.
<ul>
 
 
{|border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"  
{|border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"  
|- style="background:#F2F2F2;"
|- style="background:#F2F2F2;"
Line 48: Line 49:
|FixedCost
|FixedCost
|}
|}
</ul>
 





Revision as of 15:10, 2 October 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


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

Syntax

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

Parameters

ModelType

Required. The type of model (e.g., 2-parameter Weibull). Can be any of the model types listed in the table below. These constants are obtained from the ModelTypeEnum.

ModelCategory

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

ModelName

Required. String. The model name.

ModelParams()

Required. Double. An array of the model's parameters.


Model Type Order of Parameters
Weibull 1 = Beta, 2 = Eta, 3 = Gamma
Normal 1 = Mean, 2 = Std
Lognormal 1 = LogMean, 2 = LogStd
Exponential 1 = Lambda, 2 = Gamma
G-Gamma 1 = Mu, 2 = K
Gamma 1 = Mu, 2 = K
Logistic 1 = Mu, 2 = Sigma
LogLogistic 1 = Mu, 2 = Sigma
Gumbel 1 = Mu, 2 = Sigma
Mixed Weibull 1 = Subpop1-Beta, 2 = Subpop1-Eta, 3 = Subpop1-Portion, 4 = Subpop2-Beta, 5 = Subpop2-Eta, 6 = Subpop2-Portion, 7= Subpop3-Beta, 8 = Subpop3-Eta, 9 = Subpop3-Portion, 10 = Subpop4-Beta, 11 = Subpop4-Eta, 12 = Subpop4-Portion
FixedUnreliability If creating a constant model, enter a value for Parameter 1 and set Parameter 2 to zero (0) or nothing.
If creating a dynamic model, enter the numeric ID of the variable resource for Parameter 2 and set Parameter 1 to zero (0) or nothing. If the variable does not exist, it creates a dynamic model with no predefined variable.
FixedDuration
FixedCost


Example

VB.NET

 'The following code creates a 2-parameter Weibull reliability model, 
 'with beta 1 and eta 100. The model name is "MyNewModel." 
 Dim ModelParams(1) As Double
 ModelParams(0) = 1
 ModelParams(1) = 100
 Dim newModel As New cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability, "MyNewModel", ModelParams)

 'Alternatively, you can create a new model using an in-line parameter list. 
 Dim newModel As New cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, "MyNewModel", 1, 100)