From 4461335a0817c2f2ff1bd90d9a5713a3b1b861d7 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Tue, 10 Mar 2020 16:37:11 +0100
Subject: [PATCH] Dynamics: Allow overriding parameters for the new dynamic
 block

Simply use the arguments passed to override the arguments inherited from the parent block (including already adjusted contract/premium/deferral terms). The arguments passed to addDynamics MUST be named, otherwise they will be ignored
---
 R/InsuranceContract.R | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/R/InsuranceContract.R b/R/InsuranceContract.R
index 7ca48ea..eb5b116 100644
--- a/R/InsuranceContract.R
+++ b/R/InsuranceContract.R
@@ -152,6 +152,8 @@ InsuranceContract = R6Class(
 
             params$t = t
             params$id = id
+            # Override with arguments explicitly given
+            params[names(args)] = args[names(args)]
             params$comment = sprintf("Dynamic increase at time %d to sum %d", t, NewSumInsured)
             do.call(self$addBlock, params)
         },
-- 
GitLab