1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2016 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
22 "Verification de la disponibilite de l'ensemble des algorithmes"
24 # ==============================================================================
25 import adaoBuilder, numpy
27 """Verification de la disponibilite de l'ensemble des algorithmes"""
28 for algo in ("3DVAR", "Blue", "ExtendedBlue", "LinearLeastSquares", "NonLinearLeastSquares", ):
30 msg = "Algorithme en test : %s"%algo
31 print msg+"\n"+"="*len(msg)
33 adaopy = adaoBuilder.New()
34 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"EpsilonMinimumExponent":-10, })
35 adaopy.setBackground (Vector = [0,1,2])
36 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
37 adaopy.setObservation (Vector = [0.5,1.5,2.5])
38 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
39 adaopy.setObservationOperator(Matrix = "1 0 0;0 2 0;0 0 3")
40 adaopy.setObserver("Analysis",Template="ValuePrinter")
44 for algo in ("ExtendedKalmanFilter", "KalmanFilter", "UnscentedKalmanFilter", "4DVAR"):
46 msg = "Algorithme en test : %s"%algo
47 print msg+"\n"+"="*len(msg)
49 adaopy = adaoBuilder.New()
50 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"EpsilonMinimumExponent":-10, })
51 adaopy.setBackground (Vector = [0,1,2])
52 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
53 adaopy.setObservation (Vector = [0.5,1.5,2.5])
54 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
55 adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
56 adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
57 adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
58 adaopy.setObserver("Analysis",Template="ValuePrinter")
62 for algo in ("ParticleSwarmOptimization", "QuantileRegression", ):
64 msg = "Algorithme en test : %s"%algo
65 print msg+"\n"+"="*len(msg)
67 adaopy = adaoBuilder.New()
68 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"BoxBounds":3*[[-1,3]], "SetSeed":1000, })
69 adaopy.setBackground (Vector = [0,1,2])
70 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
71 adaopy.setObservation (Vector = [0.5,1.5,2.5])
72 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
73 adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
74 adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
75 adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
76 adaopy.setObserver("Analysis",Template="ValuePrinter")
80 for algo in ("EnsembleBlue", ):
82 msg = "Algorithme en test : %s"%algo
83 print msg+"\n"+"="*len(msg)
85 adaopy = adaoBuilder.New()
86 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"SetSeed":1000, })
87 adaopy.setBackground (VectorSerie = 100*[[0,1,2]])
88 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
89 adaopy.setObservation (Vector = [0.5,1.5,2.5])
90 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
91 adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
92 adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
93 adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
94 adaopy.setObserver("Analysis",Template="ValuePrinter")
100 #===============================================================================
101 if __name__ == "__main__":
102 print '\n AUTODIAGNOSTIC \n'