Skip to content

Commit

Permalink
Fix the bug in program, the last second validation function is working
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingru923 committed Jan 22, 2024
1 parent 306d29a commit 7651c91
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions core/src/create.jl
Original file line number Diff line number Diff line change
Expand Up @@ -704,13 +704,21 @@ function User(db::DB, config::Config)::User
first_row = time[first_row_idx]
is_active = true
else
@error "User node #$node_id data not in any table."
@error "User node $node_id data not in any table."
errors = true
end

if !all(all.(>(0), eachcol(interpolations)))
error("Demand should be a non-negative number")
for (col, id) in zip(interpolations, node_ids)
for (demand_p_itp, p_itp) in zip(col, priorities)
if any(demand_p_itp.u .< 0.0)
@error "Demand of user node $id with priority #$p_itp should be non-negative"
errors = true
end
end
end
#if !all(all.(>=(0.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)
Expand Down

0 comments on commit 7651c91

Please sign in to comment.