-
Notifications
You must be signed in to change notification settings - Fork 70
/
TwoPartCost.jl
47 lines (38 loc) · 1.15 KB
/
TwoPartCost.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#=
This file is auto-generated. Do not edit.
=#
#! format: off
"""
mutable struct TwoPartCost <: OperationalCost
variable::VariableCost
fixed::Float64
end
Data Structure Operational Cost Data in two parts: fixed and variable cost.
# Arguments
- `variable::VariableCost`: variable cost
- `fixed::Float64`: fixed cost, validation range: `(0, nothing)`, action if invalid: `warn`
"""
mutable struct TwoPartCost <: OperationalCost
"variable cost"
variable::VariableCost
"fixed cost"
fixed::Float64
end
function TwoPartCost(; variable, fixed, )
TwoPartCost(variable, fixed, )
end
# Constructor for demo purposes; non-functional.
function TwoPartCost(::Nothing)
TwoPartCost(;
variable=VariableCost((0.0, 0.0)),
fixed=0.0,
)
end
"""Get [`TwoPartCost`](@ref) `variable`."""
get_variable(value::TwoPartCost) = value.variable
"""Get [`TwoPartCost`](@ref) `fixed`."""
get_fixed(value::TwoPartCost) = value.fixed
"""Set [`TwoPartCost`](@ref) `variable`."""
set_variable!(value::TwoPartCost, val) = value.variable = val
"""Set [`TwoPartCost`](@ref) `fixed`."""
set_fixed!(value::TwoPartCost, val) = value.fixed = val