aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/scripts/ConditionalWeight.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-01-03 16:02:40 +0100
committer GitHub <noreply@github.com>2024-01-03 16:02:40 +0100
commitb06b25bd2910818029ebbf1cd3014ef20a64e25b (patch)
tree21e54285c4f3927ecd3b1b621587d75b875ac3d3 /src/openvic-simulation/scripts/ConditionalWeight.cpp
parent461ec160448373f8d9492b9c586ff53a35edef18 (diff)
parentf0dd758b6c7f35ffb1f6b237805bcb8d39c20cc5 (diff)
Merge pull request #118 from OpenVicProject/case-insensitive-registry
Added case insensitive ordered set and map and IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/scripts/ConditionalWeight.cpp')
-rw-r--r--src/openvic-simulation/scripts/ConditionalWeight.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openvic-simulation/scripts/ConditionalWeight.cpp b/src/openvic-simulation/scripts/ConditionalWeight.cpp
index 29dc93b..17bbbd6 100644
--- a/src/openvic-simulation/scripts/ConditionalWeight.cpp
+++ b/src/openvic-simulation/scripts/ConditionalWeight.cpp
@@ -23,7 +23,9 @@ static NodeCallback auto expect_modifier(std::vector<T>& items) {
node_callback_t ConditionalWeight::expect_conditional_weight(base_key_t base_key) {
return expect_dictionary_keys(
// TODO - add days and years as options with a shared expected count of ONE_EXACTLY
- base_key_to_string(base_key), ONE_EXACTLY, expect_fixed_point(assign_variable_callback(base)),
+ base_key_to_string(base_key), ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(base)),
+ "days", ZERO_OR_ONE, success_callback,
+ "years", ZERO_OR_ONE, success_callback,
"modifier", ZERO_OR_MORE, expect_modifier(condition_weight_items),
"group", ZERO_OR_MORE, [this](ast::NodeCPtr node) -> bool {
condition_weight_group_t items;