We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm new to Julia and this package, so my question may be stupid... but I just can't figure it out...
I have a state variable with three indexes, say s_{i,j,k}. I add it by:
set1 = [1, 2, 3] set2 = [0, 1, 2] set3 = [0, 1, 2] initial_state(i, j, k) = 0 @variable( subproblem, 0 <= s[i = set1, j = set2, k = set3] <= 1, SDDP.State, initial_value = initial_state(i, j, k) )
I want to add the constraint: $$ \sum_{j} \sum_{k} s_{i,j,k}=1, \forall i $$ And I tried to achieve it by:
@constraints( subproblem, begin [i in set1], sum(s[i, :, :]) == 1 end )
But there is something wrong...
MethodError: no method matching +(::SDDP.State{VariableRef}, ::SDDP.State{VariableRef})
Does anyone know why...
The text was updated successfully, but these errors were encountered:
Hi @SerenaZwww, I guess you figured this out, but you need
sum(s[i, j, k].out for j in set2, k in set3) == 1
Sorry, something went wrong.
@odow Exactly, thanks!
No branches or pull requests
I'm new to Julia and this package, so my question may be stupid... but I just can't figure it out...
I have a state variable with three indexes, say s_{i,j,k}. I add it by:
I want to add the constraint:
$$
\sum_{j} \sum_{k} s_{i,j,k}=1, \forall i
$$
And I tried to achieve it by:
But there is something wrong...
Does anyone know why...
The text was updated successfully, but these errors were encountered: