@@ -77,14 +77,14 @@ function extensive_formulation(model, param; verbose=0)
7777 [x[t+ 1 ,DIM_STATE* (m- 1 )+ k] for k = 1 : DIM_STATE] .== model. dynamics (t,
7878 [x[t,DIM_STATE* (n- 1 )+ k] for k = 1 : DIM_STATE],
7979 [u[t,DIM_CONTROL* (m- 1 )+ k] for k = 1 : DIM_CONTROL],
80- laws[t]. support[xi]))
80+ laws[t]. support[:, xi]))
8181
8282 # Add constraints to define the cost at each node
8383 @constraint (mod,
8484 c[t,m] == model. costFunctions (t,
8585 [x[t,DIM_STATE* (n- 1 )+ k] for k = 1 : DIM_STATE],
8686 [u[t,DIM_CONTROL* (m- 1 )+ k] for k = 1 : DIM_CONTROL],
87- laws[t]. support[xi]))
87+ laws[t]. support[:, xi]))
8888 end
8989 end
9090 end
@@ -94,11 +94,10 @@ function extensive_formulation(model, param; verbose=0)
9494
9595 # Define the objective of the function
9696 @objective (mod, Min,
97- sum{
98- sum{ proba[t][laws[t]. supportSize* (n- 1 )+ k]* c[t,laws[t]. supportSize* (n- 1 )+ k],
99- k = 1 : laws[t]. supportSize},
100- t = 1 : T, n= 1 : div (N[t+ 1 ],laws[t]. supportSize)}
101- )
97+ sum (
98+ sum (proba[t][laws[t]. supportSize* (n- 1 )+ k]* c[t,laws[t]. supportSize* (n- 1 )+ k]
99+ for k = 1 : laws[t]. supportSize)
100+ for t = 1 : T, n= 1 : div (N[t+ 1 ],laws[t]. supportSize)))
102101
103102 status = solve (mod)
104103 solved = (status == :Optimal )
0 commit comments