diff --git a/R/InsuranceContract.R b/R/InsuranceContract.R index 35dd45260c3b93e58517e8fe4c63ebdbd80a87e3..a7c999fb20980e59ae4813cd86f11d41c4dd53d9 100644 --- a/R/InsuranceContract.R +++ b/R/InsuranceContract.R @@ -48,6 +48,11 @@ InsuranceContract = R6Class( premiumComposition = NA ), + #### Keeping the history of all contract changes during its lifetime + history = list( + + ), + #### The code: @@ -80,6 +85,11 @@ InsuranceContract = R6Class( self$recalculate(); }, + addHistorySnapshot = function(time=0, comment="Initial contract values", type="Contract", params=self$params, values = self$values) { + self$history = c(self$history, + list("time"=time, "comment"=comment, "type"=type, "params"=params, "values"=values)); + }, + recalculate = function() { self$determineTransitionProbabilities(); self$determineCashFlows();