execmodul = None,
regles = ( AU_MOINS_UN ( 'CRITERIA' ),
AU_MOINS_UN ( 'MODEL' ),
-# A_CLASSER ( ('DISTRIBUTION', 'MODEL'), 'VARIABLE' ),
+ AVANT ( ('DISTRIBUTION', 'MODEL'), 'VARIABLE' ),
# A_CLASSER ( 'VARIABLE', 'CORRELATION' ),
# A_CLASSER ( 'VARIABLE', 'CRITERIA' ),
# A_CLASSER ( 'CORRELATION', 'CRITERIA' ),
),
) # Fin PROC LOG
+# Ordre Catalogue LOG
-#================================
-# 0. Definition du modele physique
-#================================
-
-
-DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE",
- sd_prod = variable,
- op = None,
- fr = "Variable deterministe",
- ang = "Deterministic variable",
-
- N = SIMP ( statut = 'o',
- typ = "TXM",
- fr = "Nom",
- ang = "Name",
- ),
-
- T = SIMP ( statut = 'o',
- defaut = "in",
- into = ( "in" , "out", ),
- typ = "TXM",
- fr = "Type",
- ang = "Type",
- ),
-
- R = SIMP ( statut = 'o',
- defaut = 0,
- typ = "I",
- fr = "Rang",
- ang = "Rank",
- ),
-
-) # Fin OPER DETERMINISTICVARIABLE
-
-
-
-import opsOT
-MODEL = MACRO ( nom = "MODEL",
- op = None,
- UIinfo = { "groupes" : ( "Gestion du travail", ) },
- fr = "Chargement du wrapper du modele physique",
- ang = "Physical model wrapper load",
- sd_prod = opsOT.INCLUDE,
- op_init = opsOT.INCLUDE_context,
- fichier_ini = 1,
-
- FileName = SIMP ( statut = "o",
- typ = "TXM",
- fr = "Nom du modele physique",
- ang = "Physical model identifier",
- ),
-
-) # Fin PROC MODEL
-
-
-
-
-VARIABLE = PROC ( nom = "VARIABLE",
- op = None,
- docu = "",
- fr = "Variable probabiliste",
- ang = "Probabilistic variable",
-
- ModelVariable = SIMP ( statut = "o",
- typ = ( variable, ),
- ),
-
- Distribution = SIMP ( statut = "o",
- typ = ( loi, ),
- ),
-
-) # Fin PROC VARIABLE
-
-
-CORRELATION = PROC ( nom = 'CORRELATION',
- op = None,
- docu = "",
- fr = "Correlation entre variables",
- ang = "Variable correlation",
-
- Copula = SIMP ( statut = "o",
- typ = "TXM",
- into = ( "Independent", ),
- defaut = "Independent",
- fr = "Type de la copule",
- ang = "Copula kind",
- ),
-
-
-) # Fin PROC CORRELATION
-
#================================
-# 1. Definition des LOIS
+# Definition des LOIS
#================================
# Nota : les variables de type OPER doivent etre en majuscules !
), # Fin BLOC WEIBULL
) # Fin OPER DISTRIBUTION
+# Ordre Catalogue DISTRIBUTION
+#================================
+# Definition du modele physique
+#================================
+
+
+DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE",
+ sd_prod = variable,
+ op = None,
+ fr = "Variable deterministe",
+ ang = "Deterministic variable",
+
+ N = SIMP ( statut = 'o',
+ typ = "TXM",
+ fr = "Nom",
+ ang = "Name",
+ ),
+
+ T = SIMP ( statut = 'o',
+ defaut = "in",
+ into = ( "in" , "out", ),
+ typ = "TXM",
+ fr = "Type",
+ ang = "Type",
+ ),
+
+ R = SIMP ( statut = 'o',
+ defaut = 0,
+ typ = "I",
+ fr = "Rang",
+ ang = "Rank",
+ ),
+
+) # Fin OPER DETERMINISTICVARIABLE
+# Ordre Catalogue DETERMINISTICVARIABLE
+
+
+
+import opsOT
+MODEL = MACRO ( nom = "MODEL",
+ op = None,
+ UIinfo = { "groupes" : ( "Gestion du travail", ) },
+ fr = "Chargement du wrapper du modele physique",
+ ang = "Physical model wrapper load",
+ sd_prod = opsOT.INCLUDE,
+ op_init = opsOT.INCLUDE_context,
+ fichier_ini = 1,
+
+ FileName = SIMP ( statut = "o",
+ typ = "TXM",
+ fr = "Nom du modele physique",
+ ang = "Physical model identifier",
+ ),
+
+) # Fin PROC MODEL
+# Ordre Catalogue MODEL
+
+
+
+
+VARIABLE = PROC ( nom = "VARIABLE",
+ op = None,
+ docu = "",
+ fr = "Variable probabiliste",
+ ang = "Probabilistic variable",
+
+ ModelVariable = SIMP ( statut = "o",
+ typ = ( variable, ),
+ ),
+
+ Distribution = SIMP ( statut = "o",
+ typ = ( loi, ),
+ ),
+
+) # Fin PROC VARIABLE
+# Ordre Catalogue VARIABLE
+
+
+CORRELATION = PROC ( nom = 'CORRELATION',
+ op = None,
+ docu = "",
+ fr = "Correlation entre variables",
+ ang = "Variable correlation",
+
+ Copula = SIMP ( statut = "o",
+ typ = "TXM",
+ into = ( "Independent", ),
+ defaut = "Independent",
+ fr = "Type de la copule",
+ ang = "Copula kind",
+ ),
+
+
+) # Fin PROC CORRELATION
+# Ordre Catalogue CORRELATION
+
#================================
-# 3. Definition de l'etude
+# Definition de l'etude
#================================
# Nota : les variables de type PROC doivent etre en majuscules !
) # Fin PROC CRITERIA
+# Ordre Catalogue CRITERIA
if loi.has_key( 'Kind' ):
marginale = "%s_%d" % (self.variable["marginal"], i)
txt += "# Definit la loi marginale de la composante %d\n" % i
- txt += "%s = %s\n" % (marginale, apply( STDGenerateur.__dict__[ loi[ 'Kind' ] ], (self, loi, i, self.variable["collection"]) ))
+ txt += "%s = %s\n" % (marginale, apply( STDGenerateur.__dict__[ loi[ 'Kind' ] ], (self, loi) ))
txt += "%s.setName( '%s' )\n" % (marginale, conceptloi.get_name())
txt += "%s[ %d ] = '%s'\n" % (self.variable["description"], i, variable)
txt += "%s[ %d ] = Distribution( %s )\n" % (self.variable["collection"], i, marginale)
txt += "%s = %s.drawEventProbabilitySensitivity()[0]\n" % (self.variable["eventProbabilitySensitivityGraph"], self.variable["myResult"])
txt += "#Show( %s )\n" % self.variable["eventProbabilitySensitivityGraph"]
txt += "%s = '%s'\n" % (self.variable["eventProbabilitySensitivityDrawing"], self.DictMCVal[ 'FORMEventProbabilitySensitivityDrawingFilename' ])
- txt += "%s.draw( %s )\n" % (self.variable["ieventProbabilitySensitivityGraph"], self.variable["eventProbabilitySensitivityDrawing"])
+ txt += "%s.draw( %s )\n" % (self.variable["eventProbabilitySensitivityGraph"], self.variable["eventProbabilitySensitivityDrawing"])
txt += "ViewImage( %s.getBitmap() )\n" % self.variable["eventProbabilitySensitivityGraph"]
txt += "print 'bitmap =', %s.getBitmap()\n" % self.variable["eventProbabilitySensitivityGraph"]
txt += "print 'postscript =', %s.getPostscript()\n" % self.variable["eventProbabilitySensitivityGraph"]
txt += "\n"
return txt
- def Beta (self, loi, i, collection):
+ def Beta (self, loi):
'''
Definition de la loi Beta
'''
txt = "Beta( %g, %g, %g, %g, %s )" % (arg1, arg2, arg3, arg4, settings[ loi[ 'Settings' ] ])
return txt
- def Exponential (self, loi, i, collection):
+ def Exponential (self, loi):
'''
Definition de la loi Exponential
'''
txt = "Exponential( %g, %g )" % (arg1, arg2)
return txt
- def Gamma (self, loi, i, collection):
+ def Gamma (self, loi):
'''
Definition de la loi Gamma
'''
txt = "Gamma( %g, %g, %g, %s )" % (arg1, arg2, arg3, settings[ loi[ 'Settings' ] ])
return txt
- def Geometric (self, loi, i, collection):
+ def Geometric (self, loi):
'''
Definition de la loi Geometric
'''
txt = "Geometric( %g )" % loi[ 'P' ]
return txt
- def Gumbel (self, loi, i, collection):
+ def Gumbel (self, loi):
'''
Definition de la loi Gumbel
'''
txt = "Gumbel( %g, %g, %s )" % (arg1, arg2, settings[ loi[ 'Settings' ] ])
return txt
- def Histogram (self, loi, i, collection):
+ def Histogram (self, loi):
'''
Definition de la loi Histogram
'''
txt = "Histogram( %g, %s )" % (arg1, arg2)
return txt
- def Laplace (self, loi, i, collection):
+ def Laplace (self, loi):
'''
Definition de la loi Laplace
'''
txt = "Laplace( %g, %g )" % (arg1, arg2)
return txt
- def Logistic (self, loi, i, collection):
+ def Logistic (self, loi):
'''
Definition de la loi Logistic
'''
txt = "Logistic( %g, %g )" % (arg1, arg2)
return txt
- def LogNormal (self, loi, i, collection):
+ def LogNormal (self, loi):
'''
Definition de la loi LogNormal
'''
txt = "LogNormal( %g, %g, %g, %s )" % (arg1, arg2, arg3, settings[ loi[ 'Settings' ] ])
return txt
- def MultiNomial (self, loi, i, collection):
+ def MultiNomial (self, loi):
'''
Definition de la loi MultiNomial
'''
txt = "MultiNomial( NumericalPoint( %s ) , %d)" % (arg1, arg2)
return txt
- def NonCentralStudent (self, loi, i, collection):
+ def NonCentralStudent (self, loi):
'''
Definition de la loi NonCentralStudent
'''
txt = "NonCentralStudent( %g, %g )" % (arg1, arg2, arg3)
return txt
- def Normal (self, loi, i, collection):
+ def Normal (self, loi):
'''
Definition de la loi Normal
'''
txt = "Normal( %g, %g )" % (arg1, arg2)
return txt
- def TruncatedNormal (self, loi, i, collection):
+ def TruncatedNormal (self, loi):
'''
Definition de la loi TruncatedNormal
'''
txt = "TruncatedNormal( %g, %g, %g, %g )" % (arg1, arg2, arg3, arg4)
return txt
- def Poisson (self, loi, i, collection):
+ def Poisson (self, loi):
'''
Definition de la loi Poisson
'''
txt = "Poisson( %g )" % loi[ 'Lambda' ]
return txt
- def Rayleigh (self, loi, i, collection):
+ def Rayleigh (self, loi):
'''
Definition de la loi Rayleigh
'''
txt = "Rayleigh( %g, %g )" % (arg1, arg2)
return txt
- def Student (self, loi, i, collection):
+ def Student (self, loi):
'''
Definition de la loi Student
'''
txt = "Student( %g, %g, %g )" % (arg1, arg2, arg3)
return txt
- def Triangular (self, loi, i, collection):
+ def Triangular (self, loi):
'''
Definition de la loi Triangular
'''
txt = "Triangular( %g, %g, %g )" % (arg1, arg2, arg3)
return txt
- def Uniform (self, loi, i, collection):
+ def Uniform (self, loi):
'''
Definition de la loi Uniform
'''
txt = "Uniform( %g, %g )" % (arg1, arg2)
return txt
- def UserDefined (self, loi, i, collection):
+ def UserDefined (self, loi):
'''
Definition de la loi UserDefined
'''
txt = "** UserDefined not defined yet **"
return txt
- def Weibull (self, loi, i, collection):
+ def Weibull (self, loi):
'''
Definition de la loi Weibull
'''
txt = "Weibull( %g, %g, %g, %s )" % (arg1, arg2, arg3, settings[ loi[ 'Settings' ] ])
return txt
+
+
+ def GraphiquePDF (self, loi, fichier):
+ '''
+ Produit une image PNG representant la PDF de la loi
+ '''
+ txt = headerSTD
+ txt += "dist = %s\n" % apply( STDGenerateur.__dict__[ loi[ 'Kind' ] ], (self, loi) )
+ txt += "graph = dist.drawPDF()\n"
+ txt += "graph.draw( '%s' )\n" % fichier
+ txt += footerSTD
+ return txt
+