1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2014 EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
24 from daCore import BasicObjects
27 # ==============================================================================
28 class ElementaryAlgorithm(BasicObjects.Algorithm):
30 BasicObjects.Algorithm.__init__(self, "OBSERVERTEST")
32 def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
34 print "Results of observer check on all potential variables or commands,"
35 print " only activated on selected ones by explicit association."
38 # Paramètres de pilotage
39 # ----------------------
40 self.setParameters(Parameters)
42 __Xa = 1.+numpy.arange(3.)
44 __YY = 1.+numpy.arange(5.)
46 # Activation des observers sur toutes les variables stockables
47 # ------------------------------------------------------------
48 self.StoredVariables["Analysis"].store( __Xa )
49 self.StoredVariables["CurrentState"].store( __Xa )
50 self.StoredVariables["CostFunctionJb"].store( 1. )
51 self.StoredVariables["CostFunctionJo"].store( 2. )
52 self.StoredVariables["CostFunctionJ" ].store( 3. )
54 self.StoredVariables["APosterioriCovariance"].store( numpy.diag(__Xa) )
55 self.StoredVariables["BMA"].store( __Xb - __Xa )
56 self.StoredVariables["OMA"].store( __YY )
57 self.StoredVariables["OMB"].store( __YY )
58 self.StoredVariables["Innovation"].store( __YY )
59 self.StoredVariables["SigmaObs2"].store( 1. )
60 self.StoredVariables["SigmaBck2"].store( 1. )
61 self.StoredVariables["MahalanobisConsistency"].store( 1. )
62 self.StoredVariables["SimulationQuantiles"].store( numpy.matrix((__YY,__YY,__YY)) )
68 # ==============================================================================
69 if __name__ == "__main__":
70 print '\n AUTODIAGNOSTIC \n'