From: Jean-Philippe ARGAUD Date: Sat, 31 Oct 2020 11:54:41 +0000 (+0100) Subject: Adding CurrentIterationNumber to user information and documentation X-Git-Tag: V9_7_0b1~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=399bf07d932a29e8adb8996e76de7ae3240eefa8;p=modules%2Fadao.git Adding CurrentIterationNumber to user information and documentation --- diff --git a/doc/en/ref_algorithm_3DVAR.rst b/doc/en/ref_algorithm_3DVAR.rst index 186766f..730c9c0 100644 --- a/doc/en/ref_algorithm_3DVAR.rst +++ b/doc/en/ref_algorithm_3DVAR.rst @@ -106,6 +106,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -166,6 +167,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_4DVAR.rst b/doc/en/ref_algorithm_4DVAR.rst index e335338..80b5d68 100644 --- a/doc/en/ref_algorithm_4DVAR.rst +++ b/doc/en/ref_algorithm_4DVAR.rst @@ -109,6 +109,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -147,6 +148,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_DerivativeFreeOptimization.rst b/doc/en/ref_algorithm_DerivativeFreeOptimization.rst index 5983453..961dbef 100644 --- a/doc/en/ref_algorithm_DerivativeFreeOptimization.rst +++ b/doc/en/ref_algorithm_DerivativeFreeOptimization.rst @@ -89,6 +89,7 @@ StoreSupplementaryCalculations "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -137,6 +138,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_DifferentialEvolution.rst b/doc/en/ref_algorithm_DifferentialEvolution.rst index 09af20b..04c51ef 100644 --- a/doc/en/ref_algorithm_DifferentialEvolution.rst +++ b/doc/en/ref_algorithm_DifferentialEvolution.rst @@ -97,6 +97,7 @@ StoreSupplementaryCalculations "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -145,6 +146,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_EnsembleKalmanFilter.rst b/doc/en/ref_algorithm_EnsembleKalmanFilter.rst index 8d9b951..5a48eee 100644 --- a/doc/en/ref_algorithm_EnsembleKalmanFilter.rst +++ b/doc/en/ref_algorithm_EnsembleKalmanFilter.rst @@ -99,6 +99,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -145,6 +146,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst index 57d4f20..6860d46 100644 --- a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst @@ -105,6 +105,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -151,6 +152,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_KalmanFilter.rst b/doc/en/ref_algorithm_KalmanFilter.rst index baa281f..02e01a7 100644 --- a/doc/en/ref_algorithm_KalmanFilter.rst +++ b/doc/en/ref_algorithm_KalmanFilter.rst @@ -106,6 +106,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -152,6 +153,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_NonLinearLeastSquares.rst b/doc/en/ref_algorithm_NonLinearLeastSquares.rst index d039be5..6fc563a 100644 --- a/doc/en/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/en/ref_algorithm_NonLinearLeastSquares.rst @@ -96,6 +96,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -149,6 +150,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst index e9a4e4f..ea37af7 100644 --- a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst @@ -116,10 +116,11 @@ StoreSupplementaryCalculations the following list: [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -149,14 +150,16 @@ StoreSupplementaryCalculations .. include:: snippets/BMA.rst -.. include:: snippets/CurrentState.rst - .. include:: snippets/CostFunctionJ.rst .. include:: snippets/CostFunctionJb.rst .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + +.. include:: snippets/CurrentState.rst + .. include:: snippets/Innovation.rst .. include:: snippets/OMA.rst diff --git a/doc/en/ref_algorithm_QuantileRegression.rst b/doc/en/ref_algorithm_QuantileRegression.rst index e671b6c..08769e7 100644 --- a/doc/en/ref_algorithm_QuantileRegression.rst +++ b/doc/en/ref_algorithm_QuantileRegression.rst @@ -69,6 +69,7 @@ StoreSupplementaryCalculations "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "Innovation", "OMA", @@ -99,6 +100,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. ------------------------------------ .. .. include:: snippets/Header2Algo05.rst @@ -112,6 +115,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentState.rst .. include:: snippets/Innovation.rst diff --git a/doc/en/ref_algorithm_TabuSearch.rst b/doc/en/ref_algorithm_TabuSearch.rst index 10af47e..a1245d1 100644 --- a/doc/en/ref_algorithm_TabuSearch.rst +++ b/doc/en/ref_algorithm_TabuSearch.rst @@ -93,10 +93,11 @@ StoreSupplementaryCalculations the following list: [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -126,14 +127,16 @@ StoreSupplementaryCalculations .. include:: snippets/BMA.rst -.. include:: snippets/CurrentState.rst - .. include:: snippets/CostFunctionJ.rst .. include:: snippets/CostFunctionJb.rst .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + +.. include:: snippets/CurrentState.rst + .. include:: snippets/Innovation.rst .. include:: snippets/OMA.rst diff --git a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst index 7d386c6..9f882ae 100644 --- a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst @@ -98,6 +98,7 @@ StoreSupplementaryCalculations "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "InnovationAtCurrentState", ]. @@ -131,6 +132,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentState.rst .. include:: snippets/InnovationAtCurrentState.rst diff --git a/doc/en/snippets/CurrentIterationNumber.rst b/doc/en/snippets/CurrentIterationNumber.rst new file mode 100644 index 0000000..d1eea00 --- /dev/null +++ b/doc/en/snippets/CurrentIterationNumber.rst @@ -0,0 +1,8 @@ +.. index:: single: CurrentIterationNumber + +CurrentIterationNumber + *List of integers*. Each element is the iteration index at the current step during the + iterative algorithm procedure. + + Example: + ``i = ADD.get("CurrentIterationNumber")[-1]`` diff --git a/doc/fr/ref_algorithm_3DVAR.rst b/doc/fr/ref_algorithm_3DVAR.rst index 10023d3..dd04163 100644 --- a/doc/fr/ref_algorithm_3DVAR.rst +++ b/doc/fr/ref_algorithm_3DVAR.rst @@ -108,6 +108,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -168,6 +169,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_4DVAR.rst b/doc/fr/ref_algorithm_4DVAR.rst index 4a10464..a047072 100644 --- a/doc/fr/ref_algorithm_4DVAR.rst +++ b/doc/fr/ref_algorithm_4DVAR.rst @@ -111,6 +111,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -149,6 +150,7 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst b/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst index c560d58..be78c6d 100644 --- a/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst +++ b/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst @@ -91,6 +91,7 @@ StoreSupplementaryCalculations "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -139,6 +140,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_DifferentialEvolution.rst b/doc/fr/ref_algorithm_DifferentialEvolution.rst index c21a609..3a79289 100644 --- a/doc/fr/ref_algorithm_DifferentialEvolution.rst +++ b/doc/fr/ref_algorithm_DifferentialEvolution.rst @@ -98,6 +98,7 @@ StoreSupplementaryCalculations "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -146,6 +147,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_EnsembleKalmanFilter.rst b/doc/fr/ref_algorithm_EnsembleKalmanFilter.rst index 61cd540..5081d4b 100644 --- a/doc/fr/ref_algorithm_EnsembleKalmanFilter.rst +++ b/doc/fr/ref_algorithm_EnsembleKalmanFilter.rst @@ -100,6 +100,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -146,6 +147,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst index 38accd4..4b37004 100644 --- a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst @@ -106,6 +106,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -152,6 +153,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_KalmanFilter.rst b/doc/fr/ref_algorithm_KalmanFilter.rst index 55e48e6..a9079e2 100644 --- a/doc/fr/ref_algorithm_KalmanFilter.rst +++ b/doc/fr/ref_algorithm_KalmanFilter.rst @@ -106,6 +106,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -152,6 +153,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst index 1b5d56a..97f47e5 100644 --- a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst @@ -99,6 +99,7 @@ StoreSupplementaryCalculations "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -153,6 +154,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentOptimum.rst .. include:: snippets/CurrentState.rst diff --git a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst index c91d3c6..c7d2390 100644 --- a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst @@ -119,10 +119,11 @@ StoreSupplementaryCalculations Les noms possibles sont dans la liste suivante : [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -152,14 +153,16 @@ StoreSupplementaryCalculations .. include:: snippets/BMA.rst -.. include:: snippets/CurrentState.rst - .. include:: snippets/CostFunctionJ.rst .. include:: snippets/CostFunctionJb.rst .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + +.. include:: snippets/CurrentState.rst + .. include:: snippets/Innovation.rst .. include:: snippets/OMA.rst diff --git a/doc/fr/ref_algorithm_QuantileRegression.rst b/doc/fr/ref_algorithm_QuantileRegression.rst index f164a3f..6dbaec6 100644 --- a/doc/fr/ref_algorithm_QuantileRegression.rst +++ b/doc/fr/ref_algorithm_QuantileRegression.rst @@ -69,6 +69,7 @@ StoreSupplementaryCalculations "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "Innovation", "OMA", @@ -100,6 +101,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. ------------------------------------ .. .. include:: snippets/Header2Algo05.rst @@ -113,6 +116,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentState.rst .. include:: snippets/Innovation.rst diff --git a/doc/fr/ref_algorithm_TabuSearch.rst b/doc/fr/ref_algorithm_TabuSearch.rst index def5e46..7080cbc 100644 --- a/doc/fr/ref_algorithm_TabuSearch.rst +++ b/doc/fr/ref_algorithm_TabuSearch.rst @@ -95,10 +95,11 @@ StoreSupplementaryCalculations Les noms possibles sont dans la liste suivante : [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -128,14 +129,16 @@ StoreSupplementaryCalculations .. include:: snippets/BMA.rst -.. include:: snippets/CurrentState.rst - .. include:: snippets/CostFunctionJ.rst .. include:: snippets/CostFunctionJb.rst .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + +.. include:: snippets/CurrentState.rst + .. include:: snippets/Innovation.rst .. include:: snippets/OMA.rst diff --git a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst index bf87d6d..a7f8ad1 100644 --- a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst @@ -99,6 +99,7 @@ StoreSupplementaryCalculations "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "InnovationAtCurrentState", ]. @@ -132,6 +133,8 @@ StoreSupplementaryCalculations .. include:: snippets/CostFunctionJo.rst +.. include:: snippets/CurrentIterationNumber.rst + .. include:: snippets/CurrentState.rst .. include:: snippets/InnovationAtCurrentState.rst diff --git a/doc/fr/snippets/CurrentIterationNumber.rst b/doc/fr/snippets/CurrentIterationNumber.rst new file mode 100644 index 0000000..63d285d --- /dev/null +++ b/doc/fr/snippets/CurrentIterationNumber.rst @@ -0,0 +1,8 @@ +.. index:: single: CurrentIterationNumber + +CurrentIterationNumber + *Liste d'entiers*. Chaque élément est l'index d'itération courant au cours du + déroulement itératif de l'algorithme utilisé. + + Exemple : + ``i = ADD.get("CurrentIterationNumber")[-1]`` diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index 0a0f31f..2a967ce 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -87,6 +87,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -201,6 +202,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Jo = float( 0.5 * _Innovation.T * RI * _Innovation ) J = Jb + Jo # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/4DVAR.py b/src/daComposant/daAlgorithms/4DVAR.py index 0b191c6..a7e8f2e 100644 --- a/src/daComposant/daAlgorithms/4DVAR.py +++ b/src/daComposant/daAlgorithms/4DVAR.py @@ -97,6 +97,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -214,6 +215,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Jo = Jo + _YmHMX.T * RI * _YmHMX Jo = 0.5 * Jo J = float( Jb ) + float( Jo ) + # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py b/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py index cac169d..93eea88 100644 --- a/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py +++ b/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py @@ -92,6 +92,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -170,6 +171,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # J = float( Jb ) + float( Jo ) # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/DifferentialEvolution.py b/src/daComposant/daAlgorithms/DifferentialEvolution.py index 4db00f7..87b3228 100644 --- a/src/daComposant/daAlgorithms/DifferentialEvolution.py +++ b/src/daComposant/daAlgorithms/DifferentialEvolution.py @@ -116,6 +116,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJAtCurrentOptimum", "CostFunctionJbAtCurrentOptimum", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -201,6 +202,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # J = float( Jb ) + float( Jo ) # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py index 1660d06..d235828 100644 --- a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py +++ b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py @@ -72,6 +72,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -220,6 +221,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): _HXa = numpy.asmatrix(numpy.ravel( H((Xa, Un)) )).T _Innovation = Ynpu - _HXa # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) # ---> avec analysis self.StoredVariables["Analysis"].store( Xa ) if self._toStore("SimulatedObservationAtCurrentAnalysis"): @@ -289,6 +291,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Stockage final supplémentaire de l'optimum en estimation de paramètres # ---------------------------------------------------------------------- if self._parameters["EstimationOf"] == "Parameters": + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( XaMin ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( covarianceXaMin ) diff --git a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py index 6b831e5..a2a39d6 100644 --- a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py @@ -66,6 +66,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -134,6 +135,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Pn = B # if len(self.StoredVariables["Analysis"])==0 or not self._parameters["nextStep"]: + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( numpy.ravel(Xn) ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) ) @@ -201,6 +203,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Pn = Pn_predicted - Kn * Ht * Pn_predicted Xa, _HXa = Xn, _HX # Pointeurs # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) # ---> avec analysis self.StoredVariables["Analysis"].store( Xa ) if self._toStore("SimulatedObservationAtCurrentAnalysis"): @@ -265,6 +268,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Stockage final supplémentaire de l'optimum en estimation de paramètres # ---------------------------------------------------------------------- if self._parameters["EstimationOf"] == "Parameters": + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( XaMin ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( covarianceXaMin ) diff --git a/src/daComposant/daAlgorithms/KalmanFilter.py b/src/daComposant/daAlgorithms/KalmanFilter.py index bfa4167..2465136 100644 --- a/src/daComposant/daAlgorithms/KalmanFilter.py +++ b/src/daComposant/daAlgorithms/KalmanFilter.py @@ -59,6 +59,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "ForecastState", @@ -125,6 +126,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Pn = B # if len(self.StoredVariables["Analysis"])==0 or not self._parameters["nextStep"]: + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( numpy.ravel(Xn) ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) ) @@ -176,6 +178,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Pn = Pn_predicted - Kn * Ht * Pn_predicted Xa, _HXa = Xn, _HX # Pointeurs # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) # ---> avec analysis self.StoredVariables["Analysis"].store( Xa ) if self._toStore("SimulatedObservationAtCurrentAnalysis"): @@ -240,6 +243,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Stockage final supplémentaire de l'optimum en estimation de paramètres # ---------------------------------------------------------------------- if self._parameters["EstimationOf"] == "Parameters": + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( XaMin ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( covarianceXaMin ) diff --git a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py index 0d976d9..eebcf2a 100644 --- a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py +++ b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py @@ -83,6 +83,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJbAtCurrentOptimum", "CostFunctionJo", "CostFunctionJoAtCurrentOptimum", + "CurrentIterationNumber", "CurrentOptimum", "CurrentState", "IndexOfOptimum", @@ -160,6 +161,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Jo = float( 0.5 * _Innovation.T * RI * _Innovation ) J = Jb + Jo # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py index 3125052..4c4eec0 100644 --- a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py +++ b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py @@ -94,10 +94,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -219,6 +220,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): qBest = copy.copy( quality ) logging.debug("%s Initialisation, Insecte = %s, Qualité = %s"%(self._name, str(Best), str(qBest))) # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"): self.StoredVariables["CurrentState"].store( Best ) self.StoredVariables["CostFunctionJb"].store( 0. ) @@ -245,6 +247,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): qBest = copy.copy( quality ) logging.debug("%s Etape %i, Insecte = %s, Qualité = %s"%(self._name, n, str(Best), str(qBest))) # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"): self.StoredVariables["CurrentState"].store( Best ) if self._toStore("SimulatedObservationAtCurrentState"): diff --git a/src/daComposant/daAlgorithms/QuantileRegression.py b/src/daComposant/daAlgorithms/QuantileRegression.py index c661567..0e59770 100644 --- a/src/daComposant/daAlgorithms/QuantileRegression.py +++ b/src/daComposant/daAlgorithms/QuantileRegression.py @@ -73,6 +73,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "Innovation", "OMA", @@ -129,6 +130,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Jb = 0. Jo = 0. J = Jb + Jo + # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( Jb ) self.StoredVariables["CostFunctionJo"].store( Jo ) self.StoredVariables["CostFunctionJ" ].store( J ) diff --git a/src/daComposant/daAlgorithms/TabuSearch.py b/src/daComposant/daAlgorithms/TabuSearch.py index f239a15..fd7ad96 100644 --- a/src/daComposant/daAlgorithms/TabuSearch.py +++ b/src/daComposant/daAlgorithms/TabuSearch.py @@ -106,10 +106,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = [ "Analysis", "BMA", - "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", + "CurrentState", "Innovation", "OMA", "OMB", @@ -247,6 +248,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): _HmX = Hm( numpy.asmatrix(numpy.ravel( _Best )).T ) _HmX = numpy.asmatrix(numpy.ravel( _HmX )).T self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HmX ) + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) ) self.StoredVariables["CostFunctionJb"].store( 0. ) self.StoredVariables["CostFunctionJo"].store( 0. ) self.StoredVariables["CostFunctionJ" ].store( _qualityBest ) diff --git a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py index 496f5d3..5af253c 100644 --- a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py @@ -92,6 +92,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", + "CurrentIterationNumber", "CurrentState", "InnovationAtCurrentState", ] @@ -281,6 +282,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Xn = numpy.min(numpy.hstack((Xn,numpy.asmatrix(self._parameters["Bounds"])[:,1])),axis=1) Xa = Xn # Pointeurs # + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) # ---> avec analysis self.StoredVariables["Analysis"].store( Xa ) if self._toStore("APosterioriCovariance"): @@ -311,6 +313,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Stockage final supplémentaire de l'optimum en estimation de paramètres # ---------------------------------------------------------------------- if self._parameters["EstimationOf"] == "Parameters": + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) self.StoredVariables["Analysis"].store( XaMin ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( covarianceXaMin ) diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index a389360..27d98e9 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -591,6 +591,7 @@ class Algorithm(object): - CostFunctionJbAtCurrentOptimum : partie ébauche à l'état optimal courant lors d'itérations - CostFunctionJo : partie observations de la fonction-coût : Jo - CostFunctionJoAtCurrentOptimum : partie observations à l'état optimal courant lors d'itérations + - CurrentIterationNumber : numéro courant d'itération dans les algorithmes itératifs, à partir de 0 - CurrentOptimum : état optimal courant lors d'itérations - CurrentState : état courant lors d'itérations - GradientOfCostFunctionJ : gradient de la fonction-coût globale @@ -645,6 +646,7 @@ class Algorithm(object): self.StoredVariables["CostFunctionJbAtCurrentOptimum"] = Persistence.OneScalar(name = "CostFunctionJbAtCurrentOptimum") self.StoredVariables["CostFunctionJo"] = Persistence.OneScalar(name = "CostFunctionJo") self.StoredVariables["CostFunctionJoAtCurrentOptimum"] = Persistence.OneScalar(name = "CostFunctionJoAtCurrentOptimum") + self.StoredVariables["CurrentIterationNumber"] = Persistence.OneIndex(name = "CurrentIterationNumber") self.StoredVariables["CurrentOptimum"] = Persistence.OneVector(name = "CurrentOptimum") self.StoredVariables["CurrentState"] = Persistence.OneVector(name = "CurrentState") self.StoredVariables["ForecastState"] = Persistence.OneVector(name = "ForecastState")