Salome HOME
avant PSEN
[tools/eficas.git] / PSEN_Eficas / PSEN_Cata.py
1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013   EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 # --------------------------------------------------
22 # debut entete
23 # --------------------------------------------------
24
25 #from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR
26 from Accas import *
27 import opsPSEN
28
29 class loi      ( ASSD ) : pass
30 class variable ( ASSD ) : pass
31 class sd_charge     ( ASSD ) : pass
32 class sd_generateur ( ASSD ) : pass
33 class sd_ligne     ( ASSD ) : pass
34 class sd_transfo ( ASSD ) : pass
35 #class sd_busbar ( sd_generateur,sd_charge ) : pass
36
37 import types
38 class Tuple:
39   def __init__(self,ntuple):
40     self.ntuple=ntuple
41
42   def __convert__(self,valeur):
43     if type(valeur) == types.StringType:
44       return None
45     if len(valeur) != self.ntuple:
46       return None
47     return valeur
48
49   def info(self):
50     return "Tuple de %s elements" % self.ntuple
51
52   __repr__=info
53   __str__=info
54
55 class Matrice:
56   def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None):
57       self.nbLigs=nbLigs
58       self.nbCols=nbCols
59       self.methodeCalculTaille=methodeCalculTaille
60       self.formatSortie=formatSortie
61       self.valSup=valSup
62       self.valMin=valMin
63       self.structure=structure
64
65   def __convert__(self,valeur):
66     # Attention ne verifie pas grand chose
67     if type(valeur) != types.ListType :
68       return None
69     return valeur
70
71   def info(self):
72       return "Matrice %s x %s" % (self.nbLigs, self.nbCols)
73
74       __repr__=info
75       __str__=info
76
77
78 #CONTEXT.debug = 1
79 JdC = JDC_CATA ( code = 'PSEN',
80                  execmodul = None,
81                  regles = ( AU_MOINS_UN ( 'PARAMETRES_PSSE' ),
82                             AU_MOINS_UN ( 'DIRECTORY' ),
83                             AU_MOINS_UN ( 'DISTRIBUTION' ),
84                             AU_MOINS_UN ( 'SIMULATION' ),
85                             AU_PLUS_UN ( 'PARAMETRES_PSSE' ),
86                             AU_PLUS_UN ( 'DIRECTORY' ),
87                             AU_PLUS_UN ( 'SIMULATION' ),
88                             AU_PLUS_UN ( 'CORRELATION' ),
89                             ),
90                  ) # Fin JDC_CATA
91
92
93 # --------------------------------------------------
94 # fin entete
95 # --------------------------------------------------
96
97 MONGENER =  OPER ( nom = "MONGENER",
98             sd_prod = sd_generateur,
99             UIinfo = {"groupes": ("CACHE")},
100             op = None,
101             fr = "Generateur",
102             ang = "Generator",
103
104   ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",),
105 )
106 MACHARGE =  OPER ( nom = "MACHARGE",
107             sd_prod = sd_charge,
108             UIinfo = {"groupes": ("CACHE")},
109             op = None,
110             fr = "Charge",
111             ang = "Load",
112
113   ID = SIMP ( statut = 'o', typ = "TXM", fr = "nom charge", ang = "load name",),
114 )
115 MALIGNE =  OPER ( nom = "MALIGNE",
116             sd_prod = sd_ligne,
117             UIinfo = {"groupes": ("CACHE")},
118             op = None,
119             fr = "Ligne",
120             ang = "Line",
121
122   ID = SIMP ( statut = 'o', typ = "TXM", fr = "nom ligne", ang = "line name",),
123 )
124 MONTRANSFO =  OPER ( nom = "MONTRANSFO",
125             sd_prod = sd_transfo,
126             UIinfo = {"groupes": ("CACHE")},
127             op = None,
128             fr = "Transformateur",
129             ang = "Transformer",
130
131   ID = SIMP ( statut = 'o', typ = "TXM", fr = "nom transformateur", ang = "transformer name",),
132 )
133
134
135
136 PARAMETRES_PSSE = PROC ( nom = "PARAMETRES_PSSE",
137              op=None,
138              docu = "",
139   COUT_COMBUSTIBLE = SIMP ( statut = "o",
140                      typ=bool,
141                      defaut=True,
142                      ),
143   COUT_DELESTAGE = SIMP ( statut = "o",
144                      typ=bool,
145                      defaut=False,
146                      ),
147   COUT_MVAR = SIMP ( statut = "o",
148                      typ=bool,
149                      defaut=False,
150                     ),
151   IMAP = SIMP ( statut = "o",
152                      typ='TXM',
153                      into=['RateA','RateB','RateC'],
154                      defaut=False,
155                     ),
156   LOCK_TAPS = SIMP ( statut = "o",
157                      typ=bool,
158                      defaut=True,
159                      ),
160   P_MIN= SIMP ( statut = "o",
161                      typ=bool,
162                      defaut=True,
163                      ),
164 )
165
166 SIMULATION = PROC ( nom = "SIMULATION",
167              op = None,
168              docu = "",
169   regles             =(EXCLUS('NUMBER_PACKAGE','CONVERGENCE'),),
170                
171   SIZE_PACKAGE = SIMP ( statut = "o",
172                  typ = "I",
173                  val_min=10,
174                  defaut=100,
175                  ),
176   NUMBER_PACKAGE = SIMP ( statut = "f",
177                  typ = "I",
178                  val_min=1,
179                  ),
180   CONVERGENCE = SIMP ( statut = "f",
181                  typ="I",
182                  into=[1],
183                 ),
184
185 ##  STUDY = SIMP ( statut = "o",
186 ##                 typ = "TXM",
187 ##                 into = ( 'N-1', 'Load', 'Wind-1', 'Wind-2', 'PV' ),
188 ##                 max=5,
189 ##                 fr = "Affichage du niveau de wrapper de la bibliotheque Open TURNS",
190 ##                 ang = "Open TURNS library debug level print",
191 ##                 ), 
192
193
194
195
196 #================================
197 # Importation des fichiers csv N-1
198 #================================
199
200 N_1_LINES = PROC( nom="N_1_LINES",
201                      op = None,
202                      docu = "",
203                      fr = "N-1 lignes",
204                      ang = "N-1 lines",
205
206   FileName = SIMP ( statut = "o",
207                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
208                     fr = "chemin du fichier csv des probabilites des defauts lignes",
209                     ang = "csv file path with probabilities of line outages",
210                     ),
211               )
212
213 N_1_TRANSFORMERS = PROC( nom="N_1_TRANSFORMERS",
214                      op = None,
215                      docu = "",
216                      fr = "N-1 transformateurs",
217                      ang = "N-1 transformers",
218
219   FileName = SIMP ( statut = "o",
220                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
221                     fr = "chemin du fichier csv des probabilites des defauts transformateur",
222                     ang = "csv file path with probabilities of transformer outages",
223                     ),
224               )
225 N_1_GENERATORS = PROC( nom="N_1_GENERATORS",
226                      op = None,
227                      docu = "",
228                      fr = "N-1 generateurs",
229                      ang = "N-1 generators",
230
231   FileName = SIMP ( statut = "o",
232                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
233                     fr = "chemin du fichier csv des probabilites des defauts generateurs",
234                     ang = "csv file path with probabilities of generator outages",
235                     ),
236               )
237 N_1_LOADS = PROC( nom="N_1_LOADS",
238                      op = None,
239                      docu = "",
240                      fr = "N-1 charges",
241                      ang = "N-1 loads",
242
243   FileName = SIMP ( statut = "o",
244                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
245                     fr = "chemin du fichier csv des probabilites des defauts charges",
246                     ang = "csv file path with probabilities of load outages",
247                     ),
248               )
249
250 #================================
251 LINE_LIST = PROC (nom='LINE_LIST',
252                 op = None,
253                 docu = "",
254                 fr = "PN",
255                 ang = "PN",
256
257                        Values = SIMP ( statut = 'o',
258                                        typ = Tuple(2),
259                                        max = '**', 
260                                        fr = "Liste de couples : largeur de classe, hauteur de classe",
261                                        ang = "Class bandwidth, class height couple list",
262                                        validators=VerifTypeTuple((sd_ligne,'R')),
263                                        ),
264 )
265 #================================
266 # Definition des LOIS
267 #================================
268
269 # Nota : les variables de type OPER doivent etre en majuscules !
270 # Nota : les variables de type OPER doivent etre de premier niveau (pas imbriquees dans un autre type)
271 DISTRIBUTION = OPER ( nom = "DISTRIBUTION",
272                       sd_prod = loi,
273                       op = 68,
274                       fr = "Definitions des lois marginales utilisees par les variables d'entree", 
275
276 #====
277 # Choisir generateur ou charge
278 #====
279
280 ##  TypeMachine = SIMP ( statut='o', typ='TXM',
281 ##                      into = ('charge','vent1','vent2','pv','N-1',),
282 ##                      ),
283   Activated = SIMP ( statut='o', typ=bool, defaut=True),
284   ComponentType = SIMP (statut='o', typ='TXM',
285                       into = ('Generator','Load','Line','Transformer'),),
286   b_gener = BLOC (condition = "ComponentType == 'Generator'",
287         Generator   = SIMP(statut='o',typ=sd_generateur,max="**", homo="SansOrdreNiDoublon"),),
288   b_charge = BLOC (condition = "ComponentType == 'Load'",
289         Load       = SIMP(statut='o',typ=sd_charge,max="**", homo="SansOrdreNiDoublon"),),
290   b_ligne = BLOC (condition = "ComponentType == 'Line'",
291         Line   = SIMP(statut='o',typ=sd_ligne,max="**", homo="SansOrdreNiDoublon"),),
292   b_transfo = BLOC (condition = "ComponentType == 'Transformer'",
293         Transformer       = SIMP(statut='o',typ=sd_transfo,max="**", homo="SansOrdreNiDoublon"),),
294 ##  b_gener = BLOC (condition = "TypeComposant == 'Generateur'",
295 ##        Generateur   = SIMP(statut='o',typ=sd_generateur,max="**", homo="SansOrdreNiDoublon"),),
296 ##  b_charge = BLOC (condition = "TypeComposant == 'Charge'",
297 ##        charge       = SIMP(statut='o',typ=sd_charge,max="**", homo="SansOrdreNiDoublon"),),  
298                       
299 #====
300 # Type de distribution
301 #====
302
303   Kind = SIMP ( statut = "o", typ = "TXM",
304                 into = ( "NonParametrique", 
305                          #"Beta",
306                          "Exponential",
307                          #"Gamma",
308                          #"Geometric",
309                          #"Gumbel",
310                          "Histogram",
311                          #"Laplace",
312                          #"Logistic",
313                          #"LogNormal",
314                          #"MultiNomial",
315                          #"NonCentralStudent",
316                          "Normal",
317                          #"Poisson",
318                          #"Rayleigh",
319                          #"Student",
320                          "PDF_from_file",
321                          #"Triangular",
322                          "TruncatedNormal",
323                          "Uniform",
324                          "UserDefined",
325                          "Weibull",
326                          ),
327                 fr = "Choix du type de la loi marginale",
328                 ang = "1D marginal distribution",
329                 ),
330
331                       
332 #====
333 # Definition des parametres selon le type de la loi
334 #====
335
336   NONPARAM = BLOC ( condition = " Kind in ( 'NonParametrique', ) ",
337              
338   FileName = SIMP ( statut = "o",
339                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
340                     fr = "Nom du modele physique",
341                     ang = "Physical model identifier",
342                     ),
343               ),
344
345 #  BETA = BLOC ( condition = " Kind in ( 'Beta', ) ",
346 #
347 #                  Settings = SIMP ( statut = "o",
348 #                                       typ = "TXM",
349 #                                       max = 1,
350 #                                       into = ( "RT", "MuSigma" ),
351 #                                       defaut = "RT",
352 #                                       fr = "Parametrage de la loi beta",
353 #                                       ang = "Beta distribution parameter set",
354 #                                       ),
355 #
356 #                  RT_Parameters = BLOC ( condition = " Settings in ( 'RT', ) ",
357 #
358 #                                      R = SIMP ( statut = "o",
359 #                                                 typ = "R",
360 #                                                 max = 1,
361 #                                                 val_min = 0.,
362 #                                                 fr = "Parametre R de la loi | R > 0",
363 #                                                 ang = "R parameter | R > 0",
364 #                                                 ),
365 #
366 #                                      # T > R
367 #                                      T = SIMP ( statut = "o",
368 #                                                 typ = "R",
369 #                                                 max = 1,
370 #                                                 val_min = 0.,
371 #                                                 fr = "Parametre T de la loi | T > R",
372 #                                                 ang = "T parameter | T > R",
373 #                                                 ),
374 #
375 #                                      ), # Fin BLOC RT_Parameters
376 #
377 #
378 #                  MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ",
379 #
380 #                                      Mu = SIMP ( statut = "o",
381 #                                                  typ = "R",
382 #                                                  max = 1,
383 #                                                  fr = "Moyenne de la loi",
384 #                                                  ang = "Mean value",
385 #                                                  ),
386 #
387 #                                      Sigma = SIMP ( statut = "o",
388 #                                                     typ = "R",
389 #                                                     max = 1,
390 #                                                     val_min = 0.,
391 #                                                     fr = "Ecart type de la loi",
392 #                                                     ang = "Standard deviation",
393 #                                                     ),
394 #
395 #                                      ), # Fin BLOC MuSigma_Parameters
396 #
397 #
398 #                  A = SIMP ( statut = "o",
399 #                             typ = "R",
400 #                             max = 1,
401 #                             fr = "Borne inferieure du support de la loi",
402 #                             ang = "Support lower bound",
403 #                             ),
404 #
405 #                  # B > A
406 #                  B = SIMP ( statut = "o",
407 #                             typ = "R",
408 #                             max = 1,
409 #                             fr = "Borne superieure du support de la loi",
410 #                             ang = "Support upper bound",
411 #                             ),
412 #
413 #  ), # Fin BLOC BETA
414
415
416
417   EXPONENTIAL = BLOC ( condition = " Kind in ( 'Exponential', ) ",
418
419                          Lambda = SIMP ( statut = "o",
420                                          typ = "R",
421                                          max = 1,
422                                          val_min = 0.,
423                                          fr = "Parametre Lambda | Lambda > 0",
424                                          ang = "Lambda parameter | Lambda > 0",
425                                          ),
426
427                          Gamma = SIMP ( statut = "o",
428                                         typ = "R",
429                                         max = 1,
430                                         fr = "Borne inferieure du support de la loi",
431                                         ang = "Support lower bound",
432                                         ),
433
434   ), # Fin BLOC EXPONENTIAL
435
436
437
438 #  GAMMA = BLOC ( condition = " Kind in ( 'Gamma', ) ",
439 #
440 #                   Settings = SIMP ( statut = "o",
441 #                                        typ = "TXM",
442 #                                        max = 1,
443 #                                        into = ( "KLambda", "MuSigma" ),
444 #                                        defaut = "KLambda",
445 #                                        fr = "Parametrage de la loi gamma",
446 #                                        ang = "Gamma distribution parameter set",
447 #                                        ),
448 #
449 #                   KLambda_Parameters = BLOC ( condition = " Settings in ( 'KLambda', ) ",
450 #
451 #                                       K = SIMP ( statut = "o",
452 #                                                  typ = "R",
453 #                                                  max = 1,
454 #                                                  val_min = 0.,
455 #                                                  fr = "Parametre K de la loi | K > 0",
456 #                                                  ang = "K parameter | K > 0",
457 #                                                  ),
458 #
459 #                                       Lambda = SIMP ( statut = "o",
460 #                                                       typ = "R",
461 #                                                       max = 1,
462 #                                                       val_min = 0.,
463 #                                                       fr = "Parametre Lambda de la loi | Lambda > 0",
464 #                                                       ang = "Lambda parameter | Lambda > 0",
465 #                                                       ),
466 #
467 #                                       ), # Fin BLOC KLambda_Parameters
468 #
469 #
470 #                   MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ",
471 #
472 #                                       Mu = SIMP ( statut = "o",
473 #                                                   typ = "R",
474 #                                                   max = 1,
475 #                                                   fr = "Moyenne de la loi",
476 #                                                   ang = "Mean value",
477 #                                                   ),
478 #
479 #                                       Sigma = SIMP ( statut = "o",
480 #                                                      typ = "R",
481 #                                                      max = 1,
482 #                                                      val_min = 0.,
483 #                                                      fr = "Ecart type de la loi",
484 #                                                      ang = "Standard deviation",
485 #                                                      ),
486 #
487 #                                       ), # Fin BLOC MuSigma_Parameters
488 #
489 #                   Gamma = SIMP ( statut = "o",
490 #                                  typ = "R",
491 #                                  max = 1,
492 #                                  fr = "Borne inferieure du supoport de la loi",
493 #                                  ang = "Support lower bound",
494 #                                  ),
495 #
496 #
497 #  ), # Fin BLOC GAMMA
498
499
500 #
501 #  GEOMETRIC = BLOC ( condition = " Kind in ( 'Geometric', ) ",
502 #
503 #                       P = SIMP ( statut = "o",
504 #                                  typ = "R",
505 #                                  max = 1,
506 #                                  val_min = 0.,
507 #                                  val_max = 1.,
508 #                                  fr = "Parametre P | 0 < P < 1",
509 #                                  ang = "P parameter | 0 < P < 1",
510 #                                  ),
511 #
512 #  ), # Fin BLOC GEOMETRIC
513 #
514 #
515 #
516 #  GUMBEL = BLOC ( condition = " Kind in ( 'Gumbel', ) ",
517 #
518 #                    Settings = SIMP ( statut = "o",
519 #                                         typ = "TXM",
520 #                                         max = 1,
521 #                                         into = ( "AlphaBeta", "MuSigma" ),
522 #                                         defaut = "AlphaBeta",
523 #                                         fr = "Parametrage de la loi gumbel",
524 #                                         ang = "Gumbel distribution parameter set",
525 #                                         ),
526 #
527 #                    AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ",
528 #
529 #                                        Alpha = SIMP ( statut = "o",
530 #                                                       typ = "R",
531 #                                                       max = 1,
532 #                                                       val_min = 0.,
533 #                                                       fr = "Parametre Alpha de la loi | Alpha > 0",
534 #                                                       ang = "Alpha parameter | Alpha > 0",
535 #                                                       ),
536 #
537 #                                        Beta = SIMP ( statut = "o",
538 #                                                      typ = "R",
539 #                                                      max = 1,
540 #                                                      fr = "Parametre Beta de la loi",
541 #                                                      ang = "Beta parameter",
542 #                                                      ),
543 #
544 #                                        ), # Fin BLOC AlphaBeta_Parameters
545 #
546 #
547 #                    MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ",
548 #
549 #                                        Mu = SIMP ( statut = "o",
550 #                                                    typ = "R",
551 #                                                    max = 1,
552 #                                                    fr = "Moyenne de la loi",
553 #                                                    ang = "Mean value",
554 #                                                    ),
555 #
556 #                                        Sigma = SIMP ( statut = "o",
557 #                                                       typ = "R",
558 #                                                       max = 1,
559 #                                                       val_min = 0.,
560 #                                                       fr = "Ecart type de la loi",
561 #                                                       ang = "Standard deviation",
562 #                                                       ),
563 #
564 #                                        ), # Fin BLOC MuSigma_Parameters
565 #
566 #  ), # Fin BLOC GUMBEL
567
568
569
570   HISTOGRAM = BLOC ( condition = " Kind in ( 'Histogram', ) ",
571
572                        First = SIMP ( statut = "o",
573                                     typ = "R",
574                                     max = 1,
575                                     fr = "Borne inferieure du supoport de la loi",
576                                     ang = "Support lower bound",
577                                     ),
578
579                        # Il faut definir une collection de couples ( x,p ) 
580                        Values = SIMP ( statut = 'o',
581                                        typ = Tuple(2),
582                                        max = '**', 
583                                        fr = "Liste de couples : largeur de classe, hauteur de classe",
584                                        ang = "Class bandwidth, class height couple list",
585                                        validators=VerifTypeTuple(('R','R')),
586                                        ),
587
588
589   ), # Fin BLOC HISTOGRAM
590
591
592
593 #  LAPLACE = BLOC ( condition = " Kind in ( 'Laplace', ) ",
594 #
595 #                   Lambda = SIMP ( statut = "o",
596 #                                   typ = "R",
597 #                                   max = 1,
598 #                                   val_min = 0.,
599 #                                   fr = "Parametre Lambda | Lambda > 0",
600 #                                   ang = "Lambda parameter | Lambda > 0",
601 #                                   ),
602 #                   
603 #                   Mu = SIMP ( statut = "o",
604 #                               typ = "R",
605 #                               max = 1,
606 #                               fr = "Moyenne de la loi",
607 #                               ang = "Mean value",
608 #                              ),
609 #
610 #  ), # Fin BLOC LAPLACE
611 #
612 #  LOGNORMAL = BLOC ( condition = " Kind in ( 'LogNormal', ) ",
613 #
614 #                     Settings = SIMP ( statut = "o",
615 #                                       typ = "TXM",
616 #                                       max = 1,
617 #                                       into = ( "MuSigmaLog", "MuSigma", "MuSigmaOverMu" ),
618 #                                       defaut = "MuSigmaLog",
619 #                                       fr = "Parametrage de la loi lognormale",
620 #                                       ang = "Lognormal distribution parameter set",
621 #                                       ),
622 #
623 #                     MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ",
624 #
625 #                                                 Mu = SIMP ( statut = "o",
626 #                                                             typ = "R",
627 #                                                             max = 1,
628 #                                                             fr = "Moyenne de la loi",
629 #                                                             ang = "Mean value",
630 #                                                             ),
631 #
632 #                                                 Sigma = SIMP ( statut = "o",
633 #                                                                typ = "R",
634 #                                                                max = 1,
635 #                                                                val_min = 0.,
636 #                                                                fr = "Ecart type de la loi",
637 #                                                                ang = "Standard deviation",
638 #                                                                ),
639 #
640 #                                                 ), # Fin BLOC MuSigma_Parameters
641 #
642 #                     MuSigmaOverMu_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaOverMu', ) ",
643 #
644 #                                                 Mu = SIMP ( statut = "o",
645 #                                                             typ = "R",
646 #                                                             max = 1,
647 #                                                             fr = "Moyenne de la loi",
648 #                                                             ang = "Mean value",
649 #                                                             ),
650 #
651 #                                                 SigmaOverMu = SIMP ( statut = "o",
652 #                                                                typ = "R",
653 #                                                                max = 1,
654 #                                                                val_min = 0.,
655 #                                                                fr = "Rapport ecart type / moyenne de la loi",
656 #                                                                ang = "Standard deviation / mean value ratio",
657 #                                                                ),
658 #
659 #                                                 ), # Fin BLOC MuSigmaOverMu_Parameters
660 #
661 #                     MuSigmaLog_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaLog', ) ",
662 #
663 #                                                    MuLog = SIMP ( statut = "o",
664 #                                                                   typ = "R",
665 #                                                                   max = 1,
666 #                                                                   fr = "Moyenne du log",
667 #                                                                   ang = "Log mean value",
668 #                                                                   ),
669 #
670 #                                                    SigmaLog = SIMP ( statut = "o",
671 #                                                                      typ = "R",
672 #                                                                      max = 1,
673 #                                                                      val_min = 0.,
674 #                                                                      fr = "Ecart type du log",
675 #                                                                      ang = "Log standard deviation",
676 #                                                                      ),
677 #                                            
678 #                                                    ), # Fin BLOC MuSigmaLog_Parameters
679 #
680 #                     Gamma = SIMP ( statut = "o",
681 #                                    typ = "R",
682 #                                    max = 1,
683 #                                    fr = "Borne inferieure du support de la loi",
684 #                                    ang = "Support lower bound",
685 #                                    ),
686 #
687 #   ), # Fin BLOC LOGNORMAL
688 #
689 #
690 #
691 #   LOGISTIC = BLOC ( condition = " Kind in ( 'Logistic', ) ",
692 #
693 #                       Alpha = SIMP ( statut = "o",
694 #                                      typ = "R",
695 #                                      max = 1,
696 #                                      fr = "Borne inferieure du supoport de la loi",
697 #                                      ang = "Support lower bound",
698 #                                      ),
699 #
700 #                       Beta = SIMP ( statut = "o",
701 #                                     typ = "R",
702 #                                     max = 1,
703 #                                     val_min = 0.,
704 #                                     fr = "Parametre Beta de la loi | Beta > 0",
705 #                                     ang = "Beta parameter | Beta > 0",
706 #                                     ),
707 #
708 #   ), # Fin BLOC LOGISTIC
709 #
710 #
711 #
712 #   MULTINOMIAL = BLOC ( condition = " Kind in ( 'MultiNomial', ) ",
713 #                         
714 #                         N = SIMP ( statut = "o",
715 #                                    typ = "I",
716 #                                    max = 1,
717 #                                    fr = "Parametre N de la loi | N > 0",
718 #                                    ang = "N parameter | N > 0",
719 #                                    ),
720 #
721 #                       # Il faut definir une collection de couples ( x,p ) 
722 #                       Values = SIMP ( statut = 'o',
723 #                                       typ = "R",
724 #                                       max = '**',
725 #                                       fr = "Liste de probabilités",
726 #                                       ang = "Probability list",
727 #                                       validators=VerifTypeTuple(('R','R')),
728 #                                       ),
729 #
730 #   ), # Fin BLOC MULTINOMIAL
731 #
732 #
733 #  NONCENTRALSTUDENT = BLOC ( condition = " Kind in ( 'NonCentralStudent', ) ",
734 #
735 #                   Nu = SIMP ( statut = "o",
736 #                               typ = "R",
737 #                               max = 1,
738 #                               fr = "Parametre Nu de la loi | Nu > 0",
739 #                               ang = "Nu parameter | Nu > 0",
740 #                              ),
741 #
742 #                   Delta = SIMP ( statut = "o",
743 #                                  typ = "R",
744 #                                  max = 1,
745 #                                  fr = "Parametre Delta de la loi | Delta > 0",
746 #                                  ang = "Delta parameter | Delta > 0",
747 #                                  ),
748 #                   
749 #                   Gamma = SIMP ( statut = "o",
750 #                                  typ = "R",
751 #                                  max = 1,
752 #                                  fr = "Parametre Gamma de centrage de la loi",
753 #                                  ang = "Gamma parameter",
754 #                                  ),
755 #
756 #  ), # Fin BLOC NONCENTRALSTUDENT
757
758
759    NORMAL = BLOC ( condition = " Kind in ( 'Normal', ) ",
760
761                     Mu = SIMP ( statut = "o",
762                                 typ = "R",
763                                 max = 1,
764                                 fr = "Moyenne de la loi",
765                                 ang = "Mean value",
766                                 ),
767
768                    Sigma = SIMP ( statut = "o",
769                                   typ = "R",
770                                   max = 1,
771                                   val_min = 0.,
772                                   fr = "Ecart type de la loi",
773                                   ang = "Standard deviation",
774                                   ),
775
776    ), # Fin BLOC NORMAL
777
778
779 #
780 #   POISSON = BLOC ( condition = " Kind in ( 'Poisson', ) ",
781 #
782 #                     Lambda = SIMP ( statut = "o",
783 #                                     typ = "R",
784 #                                     max = 1,
785 #                                     val_min = 0.,
786 #                                     fr = "Parametre Lambda de la loi | Lambda > 0",
787 #                                     ang = "Lambda parameter | Lambda > 0",
788 #                                     ),
789 #
790 #   ), # Fin BLOC POISSON
791 #
792 #
793 #
794 #  RAYLEIGH = BLOC ( condition = " Kind in ( 'Rayleigh', ) ",
795 #
796 #                   Sigma = SIMP ( statut = "o",
797 #                                  typ = "R",
798 #                                  max = 1,
799 #                                  fr = "Parametre Sigma de la loi | Sigma > 0",
800 #                                  ang = "Sigma parameter | Sigma > 0",
801 #                                  ),
802 #
803 #                   Gamma = SIMP ( statut = "o",
804 #                                  typ = "R",
805 #                                  max = 1,
806 #                                  fr = "Borne inferieure du support de la loi",
807 #                                  ang = "Support lower bound",
808 #                                  ),
809 # ), # Fin BLOC RAYLEIGH
810
811   PDF = BLOC ( condition = " Kind in ( 'PDF_from_file', ) ",
812              
813   FileName = SIMP ( statut = "o",
814                     typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),
815                     fr = "Nom du modele physique",
816                     ang = "Physical model identifier",
817                     ),
818               ),
819               
820 #   STUDENT = BLOC ( condition = " Kind in ( 'Student', ) ",
821 #
822 #                     Mu = SIMP ( statut = "o",
823 #                                 typ = "R",
824 #                                 max = 1,
825 #                                 fr = "Parametre Mu de la loi",
826 #                                 ang = "Mu parameter",
827 #                                 ),
828 #
829 #                     Nu = SIMP ( statut = "o",
830 #                                 typ = "R",
831 #                                 max = 1,
832 #                                 val_min = 2.,
833 #                                 fr = "Parametre Nu de la loi | Nu > 2",
834 #                                 ang = "Nu parameter | Nu > 2",
835 #                                 ),
836 #
837 #                   Sigma = SIMP ( statut = "o",
838 #                                  typ = "R",
839 #                                  max = 1,
840 #                                  fr = "Parametre Sigma de la loi",
841 #                                  ang = "Sigma parameter",
842 #                                  ),
843 #
844 #   ), # Fin BLOC STUDENT
845 #
846 #
847 #
848 #   TRIANGULAR = BLOC ( condition = " Kind in ( 'Triangular', ) ",
849 #
850 #                         A = SIMP ( statut = "o",
851 #                                    typ = "R",
852 #                                    max = 1,
853 #                                    fr = "Borne inferieure du support de la loi | A < M < B",
854 #                                    ang = "Support lower bound | A < M < B",
855 #                                    ),
856 #
857 #                         M = SIMP ( statut = "o",
858 #                                    typ = "R",
859 #                                    max = 1,
860 #                                    fr = "Mode de la loi | A < M < B",
861 #                                    ang = "Mode | A < M < B",
862 #                                    ),
863 #
864 #                         B = SIMP ( statut = "o",
865 #                                    typ = "R",
866 #                                    max = 1,
867 #                                    fr = "Borne superieure du support de la loi | A < M < B",
868 #                                    ang = "Support upper bound | A < M < B",
869 #                                    ),
870 #
871 #   ), # Fin BLOC TRIANGULAR
872 #
873 #
874
875    TRUNCATEDNORMAL = BLOC ( condition = " Kind in ( 'TruncatedNormal', ) ",
876
877                              MuN = SIMP ( statut = "o",
878                                           typ = "R",
879                                           max = 1,
880                                           fr = "Moyenne de la loi Normale non tronquée",
881                                           ang = "Mean value of the associated non truncated normal distribution",
882                                           ),
883
884                              SigmaN = SIMP ( statut = "o",
885                                              typ = "R",
886                                              max = 1,
887                                              val_min = 0.,
888                                              fr = "Ecart-type de la loi Normale non tronquée",
889                                              ang = "Standard deviation of the associated non truncated normal distribution",
890                                              ),
891
892                              A = SIMP ( statut = "o",
893                                         typ = "R",
894                                         max = 1,
895                                         fr = "Borne inferieure de la loi | A < B",
896                                         ang = "Lower bound | A < B",
897                                         ),
898
899                              B = SIMP ( statut = "o",
900                                         typ = "R",
901                                         max = 1,
902                                         fr = "Borne superieure de la loi | A < B",
903                                         ang = "Upper bound | A < B",
904                                         ),
905
906    ), # Fin BLOC TRUNCATEDNORMAL
907
908
909
910    UNIFORM = BLOC ( condition = " Kind in ( 'Uniform', ) ",
911
912                      A = SIMP ( statut = "o",
913                                 typ = "R",
914                                 max = 1,
915                                 fr = "Borne inferieure du support de la loi | A < B",
916                                 ang = "Support lower bound | A < B",
917                                 ),
918
919                      B = SIMP ( statut = "o",
920                                 typ = "R",
921                                 max = 1,
922                                 fr = "Borne superieure du support de la loi | A < B",
923                                 ang = "Support upper bound | A < B",
924                                 ),
925
926    ), # Fin BLOC UNIFORM
927
928
929
930    USERDEFINED = BLOC ( condition = " Kind in ( 'UserDefined', ) ",
931
932                            # Il faut definir une collection de couples ( x,p ) 
933                          Fichier = SIMP ( statut = 'o',
934                                          typ =( 'Fichier', 'CSV (*.csv);;All Files (*)',),
935                                       
936                                          ),
937
938    ), # Fin BLOC USERDEFINED
939
940
941
942    WEIBULL = BLOC ( condition = " Kind in ( 'Weibull', ) ",
943
944                      Settings = SIMP ( statut = "o",
945                                           typ = "TXM",
946                                           max = 1,
947                                           into = ( "AlphaBeta", "MuSigma" ),
948                                           defaut = "AlphaBeta",
949                                           fr = "Parametrage de la loi weibull",
950                                           ang = "Weibull distribution parameter set",
951                                           ),
952
953                      AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ",
954
955                                          Alpha = SIMP ( statut = "o",
956                                                         typ = "R",
957                                                         max = 1,
958                                                         val_min = 0.,
959                                                         fr = "Parametre Alpha de la loi | Alpha > 0",
960                                                         ang = "Alpha parameter | Alpha > 0",
961                                                         ),
962
963                                          Beta = SIMP ( statut = "o",
964                                                        typ = "R",
965                                                        max = 1,
966                                                        val_min = 0.,
967                                                        fr = "Parametre Beta de la loi | Beta > 0",
968                                                        ang = "Beta parameter | Beta > 0",
969                                                        ),
970
971                                          ), # Fin BLOC AlphaBeta_Parameters
972
973
974                      MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ",
975
976                                          Mu = SIMP ( statut = "o",
977                                                      typ = "R",
978                                                      max = 1,
979                                                      fr = "Moyenne de la loi",
980                                                      ang = "Mean value",
981                                                      ),
982
983                                          Sigma = SIMP ( statut = "o",
984                                                         typ = "R",
985                                                         max = 1,
986                                                         val_min = 0.,
987                                                         fr = "Ecart type de la loi",
988                                                         ang = "Standard deviation",
989                                                         ),
990
991                                          ), # Fin BLOC MuSigma_Parameters
992
993                      Gamma = SIMP ( statut = "o",
994                                     typ = "R",
995                                     max = 1,
996                                     fr = "Borne inferieure du support de la loi",
997                                     ang = "Support lower bound",
998                                     ),
999
1000     ), # Fin BLOC WEIBULL
1001
1002
1003
1004
1005
1006 #================================
1007 # Definition du modele physique
1008 #================================
1009
1010
1011
1012 CORRELATION = PROC ( nom = 'CORRELATION',
1013                      op = None,
1014                      docu = "",
1015                      fr = "Correlation entre variables",
1016                      ang = "Variable correlation",
1017
1018 ####  Copula = SIMP ( statut = "o",
1019 ####                  typ = 'TXM',
1020 ####                  into = ( "Independent", "Normal" ),
1021 ####                  defaut = "Independent",
1022 ####                  fr = "Type de la copule",
1023 ####                  ang = "Copula kind",
1024 ####                  ),
1025 ##
1026 ## # Matrix = BLOC ( condition = "Copula in ( 'Normal', )",
1027 ##                  
1028     CorrelationMatrix = SIMP ( statut = "o",
1029                                typ = Matrice(nbLigs=None,
1030                                              nbCols=None,
1031                                              methodeCalculTaille='NbDeDistributions',
1032                                              structure="symetrique"),
1033                                fr = "Matrice de correlation entre les variables d'entree",
1034                                ang = "Correlation matrix for input variables",
1035                                ),
1036 ##  #), # Fin BLOC Matrix
1037 ##
1038 ##
1039
1040
1041 DIRECTORY = MACRO ( nom = 'DIRECTORY',
1042         op=None,
1043         fr = "Chargement des generateurs et des charges",
1044         ang = "Physical model wrapper load",
1045                 sd_prod = opsPSEN.INCLUDE,
1046                 op_init = opsPSEN.INCLUDE_context,
1047                 #sd_prod=None,
1048                 fichier_ini = 1,
1049         
1050         sav_file=SIMP(statut="o", typ = ('Fichier', 'Wrapper Files (*.sav);;All Files (*)',),),
1051         results_folder=SIMP(statut="o",typ='Repertoire'),
1052         #lines_file=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),),
1053         #groups_file=SIMP(statut="o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),),
1054         #generationsystem_file=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),),        
1055         PSSE_path=SIMP(statut="o",typ='Repertoire'),
1056
1057
1058 Classement_Commandes_Ds_Arbre=('DIRECTORY','DISTRIBUTION','CORRELATION')
1059
1060