Skip to content
Snippets Groups Projects
Commit 10c210e0 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add history to the contract class

parent 0099a951
Branches
Tags
No related merge requests found
...@@ -48,6 +48,11 @@ InsuranceContract = R6Class( ...@@ -48,6 +48,11 @@ InsuranceContract = R6Class(
premiumComposition = NA premiumComposition = NA
), ),
#### Keeping the history of all contract changes during its lifetime
history = list(
),
#### The code: #### The code:
...@@ -80,6 +85,11 @@ InsuranceContract = R6Class( ...@@ -80,6 +85,11 @@ InsuranceContract = R6Class(
self$recalculate(); 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() { recalculate = function() {
self$determineTransitionProbabilities(); self$determineTransitionProbabilities();
self$determineCashFlows(); self$determineCashFlows();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment