Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic Jacobian sparsity #1606

Merged
merged 35 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
84a9f3c
Symbolic Jacobian sparsity
visr Jul 3, 2024
547aef4
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Jul 24, 2024
b5861cf
Non-branching reduction factor
SouthEndMusic Jul 24, 2024
101c397
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Jul 29, 2024
0966f53
Manifest update
SouthEndMusic Jul 29, 2024
a7ad503
Upgrade to DataInterpolations 6
SouthEndMusic Jul 29, 2024
f454301
POC!
SouthEndMusic Jul 30, 2024
34bd75c
Support more node types
SouthEndMusic Jul 30, 2024
2002b70
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Jul 30, 2024
1cee9e1
Fix many tests
SouthEndMusic Jul 30, 2024
7869163
pass all test (!)
SouthEndMusic Jul 31, 2024
f7cf558
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Jul 31, 2024
a5e990a
Docs fix
SouthEndMusic Jul 31, 2024
2676c22
Make sure all nodes are active when detecting Jacobian sparsity
SouthEndMusic Jul 31, 2024
e0a5519
Use LazyBufferCache initialization feature
SouthEndMusic Jul 31, 2024
aab4085
Some comments adressed (work done yesterday)
SouthEndMusic Aug 2, 2024
81420e5
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 5, 2024
2c39729
Pass tests
SouthEndMusic Aug 5, 2024
4664f01
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 6, 2024
f589be2
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 6, 2024
8b6b97f
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 6, 2024
2be2b05
Use tracerLocalSparsityDetector
SouthEndMusic Aug 7, 2024
e008204
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 7, 2024
7d5e65e
Update SparseConnectivityTracer version
SouthEndMusic Aug 8, 2024
f02891b
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 13, 2024
390e00c
Update dependency versions
SouthEndMusic Aug 13, 2024
69896f1
Add custom overloads
SouthEndMusic Aug 16, 2024
9ae49fb
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 16, 2024
20e7fe1
Use the safe TracerSparsityDetector, revert reduction factor changes
SouthEndMusic Aug 16, 2024
0df1dcc
Mute type piracy error
SouthEndMusic Aug 16, 2024
956f77e
nit
SouthEndMusic Aug 16, 2024
b8916ae
Cleanup manifest
SouthEndMusic Aug 16, 2024
062a01c
Use latest release of SparseConnectivityTracer
SouthEndMusic Aug 19, 2024
4064042
Use latest re;ease of DataInterpolations
SouthEndMusic Aug 19, 2024
87f702e
Merge branch 'main' into symbolic-jacobian-sparsity
SouthEndMusic Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix many tests
  • Loading branch information
SouthEndMusic committed Jul 30, 2024
commit 1cee9e1aa20b6c545fb2c4b66b7685098752a5bd
84 changes: 38 additions & 46 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "d5247101eb296198406ab040fca3c997b4be7438"
project_hash = "8ad2e1d2cd27e966bfbcd2b9911ef68d4c3b81ef"

[[deps.ADTypes]]
git-tree-sha1 = "aa4d425271a914d8c4af6ad9fccb6eb3aec662c7"
Expand Down Expand Up @@ -72,10 +72,10 @@ uuid = "ec485272-7323-5ecc-a04f-4719b315124d"
version = "0.4.0"

[[deps.ArrayInterface]]
deps = ["Adapt", "LinearAlgebra"]
git-tree-sha1 = "8c5b39db37c1d0340bf3b14895fba160c2d6cbb5"
deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "5c9b74c973181571deb6442d41e5c902e6b9f38e"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "7.14.0"
version = "7.12.0"

[deps.ArrayInterface.extensions]
ArrayInterfaceBandedMatricesExt = "BandedMatrices"
Expand All @@ -85,8 +85,7 @@ version = "7.14.0"
ArrayInterfaceChainRulesExt = "ChainRules"
ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore"
ArrayInterfaceReverseDiffExt = "ReverseDiff"
ArrayInterfaceSparseArraysExt = "SparseArrays"
ArrayInterfaceStaticArraysExt = "StaticArrays"
ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore"
ArrayInterfaceTrackerExt = "Tracker"

[deps.ArrayInterface.weakdeps]
Expand All @@ -97,8 +96,7 @@ version = "7.14.0"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"

[[deps.ArrayLayouts]]
Expand Down Expand Up @@ -259,9 +257,9 @@ version = "1.1.1+0"

[[deps.ComponentArrays]]
deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "Functors", "LinearAlgebra", "PackageExtensionCompat", "StaticArrayInterface", "StaticArraysCore"]
git-tree-sha1 = "cf30651e65a87b20b12601b91169a18838eab2df"
git-tree-sha1 = "c2663c30580894680c793d6b8043567b5f4d4878"
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
version = "0.15.16"
version = "0.15.14"

[deps.ComponentArrays.extensions]
ComponentArraysAdaptExt = "Adapt"
Expand Down Expand Up @@ -571,22 +569,16 @@ git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
version = "0.1.10"

[[deps.Expronicon]]
deps = ["MLStyle", "Pkg", "TOML"]
git-tree-sha1 = "fc3951d4d398b5515f91d7fe5d45fc31dccb3c9b"
uuid = "6b7a57c9-7cc1-4fdf-b7f5-e857abae3636"
version = "0.8.5"

[[deps.ExproniconLite]]
git-tree-sha1 = "1095361e35ea8ad9c660560df4c03c06d5244956"
uuid = "55351af7-c7e9-48d6-89ff-24e801d99491"
version = "0.10.11"

[[deps.FastBroadcast]]
deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"]
git-tree-sha1 = "ab1b34570bcdf272899062e1a56285a53ecaae08"
git-tree-sha1 = "bd19de6fe8a3b18888f35e79832f97544684caa7"
uuid = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
version = "0.3.5"
version = "0.3.4"

[[deps.FastClosures]]
git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef"
Expand Down Expand Up @@ -814,10 +806,10 @@ uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"

[[deps.JLD2]]
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"]
git-tree-sha1 = "67d4690d32c22e28818a434b293a374cc78473d3"
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"]
git-tree-sha1 = "5fe858cb863e211c6dedc8cce2dc0752d4ab6e2b"
uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
version = "0.4.51"
version = "0.4.50"

[[deps.JLLWrappers]]
deps = ["Artifacts", "Preferences"]
Expand Down Expand Up @@ -855,9 +847,9 @@ version = "1.22.2"

[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "5d3a5a206297af3868151bb4a2cf27ebce46f16d"
git-tree-sha1 = "a6adc2dcfe4187c40dc7c2c9d2128e326360e90a"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.33"
version = "0.9.32"

[[deps.KLU]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"]
Expand Down Expand Up @@ -1057,27 +1049,22 @@ weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"]

[[deps.LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "1ce1834f9644a8f7c011eb0592b7fd6c42c90653"
git-tree-sha1 = "eeaedcf337f33c039f9f3a209a8db992deefd7e9"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "3.0.1"
version = "2.4.8"

[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "7f26c8fc5229e68484e0b3447312c98e16207d11"
git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.10.0+0"
version = "1.9.4+0"

[[deps.MKL_jll]]
deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"]
git-tree-sha1 = "f046ccd0c6db2832a9f639e2c669c6fe867e5f4f"
uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
version = "2024.2.0+0"

[[deps.MLStyle]]
git-tree-sha1 = "bc38dff0548128765760c79eb7388a4b37fae2c8"
uuid = "d8e11817-5142-5d16-987a-aa16d5891078"
version = "0.4.17"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df"
Expand Down Expand Up @@ -1139,9 +1126,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[deps.Mocking]]
deps = ["Compat", "ExprTools"]
git-tree-sha1 = "c74e5e7c5f83ccb0bca0377d316d966d296106d4"
git-tree-sha1 = "bf17d9cb4f0d2882351dfad030598f64286e5936"
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
version = "0.7.9"
version = "0.7.8"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
Expand Down Expand Up @@ -1244,9 +1231,9 @@ version = "1.6.3"

[[deps.OrdinaryDiffEq]]
deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"]
git-tree-sha1 = "a8b2d333cd90562b58b977b4033739360b37fb1f"
git-tree-sha1 = "0c5d89483f9538efedb3f1c1b72e14d5f65830b0"
uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
version = "6.87.0"
version = "6.86.0"

[[deps.OteraEngine]]
deps = ["Markdown", "Pkg", "TOML"]
Expand Down Expand Up @@ -1376,6 +1363,11 @@ git-tree-sha1 = "276cb2fc9c4de5ea62fd50150d9089ab5a40781f"
uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
version = "1.24.0"

[[deps.ReadOnlyArrays]]
git-tree-sha1 = "e6f7ddf48cf141cb312b078ca21cb2d29d0dc11d"
uuid = "988b38a3-91fc-5605-94a2-ee2116b3bd83"
version = "0.2.0"

[[deps.RecipesBase]]
deps = ["PrecompileTools"]
git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff"
Expand Down Expand Up @@ -1430,10 +1422,10 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "183ea9da1c6b1875a7c2280a86c673ab90383bf4"
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "85ddd93ea15dcd8493400600e09104a9e94bb18d"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.5.17"
version = "3.5.15"

[[deps.Ribasim]]
deps = ["Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqCallbacks", "EnumX", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Symbolics", "Tables", "TerminalLoggers", "TimerOutputs", "TranscodingStreams"]
Expand Down Expand Up @@ -1487,10 +1479,10 @@ uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8"
version = "3.45.3+0"

[[deps.SciMLBase]]
deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
git-tree-sha1 = "380a059a9fd18a56d98e50ed98d40e1c1202e662"
deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
git-tree-sha1 = "4345907b161ed71358fd343f8d9d178b68bb185a"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
version = "2.46.0"
version = "2.43.1"

[deps.SciMLBase.extensions]
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -1550,9 +1542,9 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[deps.SimpleNonlinearSolve]]
deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DiffResults", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "MaybeInplace", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"]
git-tree-sha1 = "03c21a4c373c7c3aa77611430068badaa073d740"
git-tree-sha1 = "58b144f34e44252b2de0acb5a9dbbb7ea5cd75d7"
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
version = "1.11.0"
version = "1.10.1"

[deps.SimpleNonlinearSolve.extensions]
SimpleNonlinearSolveChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -1863,9 +1855,9 @@ uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf"
version = "0.2.1"

[[deps.Tricks]]
git-tree-sha1 = "7822b97e99a1672bfb1b49b668a6d46d58d8cbcb"
git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f"
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
version = "0.1.9"
version = "0.1.8"

[[deps.TruncatedStacktraces]]
deps = ["InteractiveUtils", "MacroTools", "Preferences"]
Expand Down
11 changes: 8 additions & 3 deletions core/src/callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ end

function update_subgrid_level!(integrator)::Nothing
(; u, p) = integrator
basin_level = p.basin.current_level[u]
basin_level = p.basin.current_level[parent(u)]
subgrid = integrator.p.subgrid
for (i, (index, interp)) in enumerate(zip(subgrid.basin_index, subgrid.interpolations))
subgrid.level[i] = interp(basin_level[index])
Expand All @@ -437,7 +437,7 @@ function update_basin!(integrator)::Nothing
(; storage) = u
(; node_id, time, vertical_flux_from_input, vertical_flux, vertical_flux_prev) = basin
t = datetime_since(integrator.t, integrator.p.starttime)
vertical_flux = vertical_flux[u]
vertical_flux = vertical_flux[parent(u)]

rows = searchsorted(time.time, t)
timeblock = view(time, rows)
Expand Down Expand Up @@ -535,7 +535,12 @@ function update_tabulated_rating_curve!(integrator)::Nothing
level = [row.level for row in group]
flow_rate = [row.flow_rate for row in group]
i = searchsortedfirst(node_id, NodeID(NodeType.TabulatedRatingCurve, id, 0))
table[i] = LinearInterpolation(flow_rate, level; extrapolate = true)
table[i] = LinearInterpolation(
flow_rate,
level;
extrapolate = true,
cache_parameters = true,
)
end
return nothing
end
Expand Down
4 changes: 2 additions & 2 deletions core/src/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ end

function set_flow!(graph, flow_idx::Int, q::Number, u)::Nothing
(; flow) = graph[]
flow[u][flow_idx] = q
flow[Ref(q)][flow_idx] = q
return nothing
end

Expand Down Expand Up @@ -223,7 +223,7 @@ end

function get_flow_prev(graph::MetaGraph, flow_idx::Int, val)
# Note: Can be removed after https://github.com/Deltares/Ribasim/pull/1444
return graph[].flow_prew[val][flow_idx]
return graph[].flow_prev[val][flow_idx]
end

"""
Expand Down
34 changes: 17 additions & 17 deletions core/src/parameter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,15 @@ end
A variant on `Base.Ref` where the source array is a vector that is possibly wrapped in a ForwardDiff.DiffCache.
Retrieve value with get_value(ref::PreallocationRef, val) where `val` determines the return type.
"""
struct PreallocationRef{T}
vector::T
struct PreallocationRef
vector::LBC
idx::Int
end

get_value(ref::PreallocationRef, val) = ref.vector[val][ref.idx]

function set_value!(ref::PreallocationRef, value)::Nothing
get_tmp(ref.vector, value)[ref.idx] = value
function set_value!(ref::PreallocationRef, value, val)::Nothing
ref.vector[val][ref.idx] = value
return nothing
end

Expand All @@ -561,12 +561,12 @@ subvariables: data for one single subvariable
greater_than: the thresholds this compound variable will be
compared against (in the case of DiscreteControl)
"""
@kwdef struct CompoundVariable{T}
@kwdef struct CompoundVariable
node_id::NodeID
subvariables::Vector{
@NamedTuple{
listen_node_id::NodeID,
variable_ref::PreallocationRef{T},
variable_ref::PreallocationRef,
variable::String,
weight::Float64,
look_ahead::Float64,
Expand All @@ -586,10 +586,10 @@ logic_mapping: Dictionary: truth state => control state for the DiscreteControl
control_mapping: dictionary node type => control mapping for that node type
record: Namedtuple with discrete control information for results
"""
@kwdef struct DiscreteControl{T} <: AbstractParameterNode
@kwdef struct DiscreteControl <: AbstractParameterNode
node_id::Vector{NodeID}
controlled_nodes::Vector{Vector{NodeID}}
compound_variables::Vector{Vector{CompoundVariable{T}}}
compound_variables::Vector{Vector{CompoundVariable}}
truth_state::Vector{Vector{Bool}}
control_state::Vector{String} = fill("undefined_state", length(node_id))
control_state_start::Vector{Float64} = zeros(length(node_id))
Expand All @@ -609,11 +609,11 @@ record: Namedtuple with discrete control information for results
)
end

@kwdef struct ContinuousControl{T} <: AbstractParameterNode
@kwdef struct ContinuousControl <: AbstractParameterNode
node_id::Vector{NodeID}
compound_variable::Vector{CompoundVariable{T}}
compound_variable::Vector{CompoundVariable}
controlled_variable::Vector{String}
target_ref::Vector{PreallocationRef{T}}
target_ref::Vector{PreallocationRef}
func::Vector{ScalarInterpolation}
end

Expand All @@ -632,16 +632,16 @@ derivative: proportionality coefficient error derivative
error: the current error; basin_target - current_level
dictionary from (node_id, control_state) to target flow rate
"""
@kwdef struct PidControl{T} <: AbstractParameterNode
@kwdef struct PidControl <: AbstractParameterNode
node_id::Vector{NodeID}
active::Vector{Bool}
listen_node_id::Vector{NodeID}
target::Vector{ScalarInterpolation}
target_ref::Vector{PreallocationRef{T}}
target_ref::Vector{PreallocationRef}
proportional::Vector{ScalarInterpolation}
integral::Vector{ScalarInterpolation}
derivative::Vector{ScalarInterpolation}
error::T
error::LBC = LazyBufferCache(CallableInt(length(node_id)))
controlled_basins::Vector{NodeID}
control_mapping::Dict{Tuple{NodeID, String}, ControlStateUpdate}
end
Expand Down Expand Up @@ -749,7 +749,7 @@ const ModelGraph = MetaGraph{
Float64,
}

@kwdef struct Parameters{T, C1, C2, V1, V2}
@kwdef struct Parameters{C1, C2, V1, V2}
starttime::DateTime
graph::ModelGraph
allocation::Allocation
Expand All @@ -762,8 +762,8 @@ const ModelGraph = MetaGraph{
pump::Pump
outlet::Outlet
terminal::Terminal
discrete_control::DiscreteControl{T}
continuous_control::ContinuousControl{T}
discrete_control::DiscreteControl
continuous_control::ContinuousControl
pid_control::PidControl
user_demand::UserDemand
level_demand::LevelDemand
Expand Down
Loading
Loading