diff --git a/core/src/create.jl b/core/src/create.jl index 46a5f9ada..a76d7259f 100644 --- a/core/src/create.jl +++ b/core/src/create.jl @@ -199,6 +199,19 @@ const nonconservative_nodetypes = function generate_allocation_models!(p::Parameters, config::Config)::Nothing (; graph, allocation_models) = p + errors = false + + for allocation_network_id in keys(graph[].node_ids) + if (allocation_network_id <= 0) + @error "Allocation network id $allocation_network_id needs to be a positive integer." + errors = true + end + end + + if errors + error("Allocation network initialization failed.") + end + for allocation_network_id in keys(graph[].node_ids) push!( allocation_models, @@ -695,6 +708,10 @@ function User(db::DB, config::Config)::User errors = true end + if !all(all.(>(0), eachcol(interpolations))) + error("Demand should be a non-negative number") + end + if !isnothing(first_row) min_level_ = coalesce(first_row.min_level, 0.0) return_factor_ = first_row.return_factor