@@ -432,6 +432,8 @@ facts("SDP algorithm") do
432432
433433 @fact test_costs --> true
434434
435+ @fact convertedSDPmodel. constraints (1 ,x,u,w) --> true
436+
435437 end
436438
437439 context (" Solve and simulate using SDP" ) do
@@ -445,8 +447,6 @@ facts("SDP algorithm") do
445447 aleas_scen, x0,
446448 V_sdp, true )
447449
448- println (size (stocks_sdp))
449- println (size (controls_sdp))
450450
451451 costs_sdp2, stocks_sdp2, controls_sdp2 = StochDynamicProgramming. sdp_forward_simulation (modelSDP,
452452 paramsSDP,
@@ -471,6 +471,15 @@ facts("SDP algorithm") do
471471 @fact v1 --> v2
472472 @fact (v1<= v3) --> true
473473
474+ paramsSDP. infoStructure = " DH"
475+ costs_sdp3, stocks_sdp3, controls_sdp3 = StochDynamicProgramming. sdp_forward_simulation (modelSDP,
476+ paramsSDP,
477+ aleas_scen,
478+ V_sdp3, true )
479+ paramsSDP. infoStructure = " HD"
480+
481+ @fact costs_sdp3[1 ]>= costs_sdp2[1 ] --> true
482+
474483 a,b = StochDynamicProgramming. generate_grid (modelSDP, paramsSDP)
475484
476485 x_bounds = modelSDP. xlim
@@ -494,11 +503,15 @@ facts("SDP algorithm") do
494503 state_ref = zeros (2 )
495504 state_ref[1 ] = stocks_sdp[2 ,1 ,1 ]
496505 state_ref[2 ] = stocks_sdp[2 ,1 ,2 ]
506+ w = [4 ]
497507
498508 @fact_throws get_control (modelSDP,paramsSDP,V_sdp3, 1 , x)
509+ @fact (get_control (modelSDP,paramsSDP,V_sdp3, 1 , x, w)[1 ] >= CONTROL_MIN) --> true
510+ @fact (get_control (modelSDP,paramsSDP,V_sdp3, 1 , x, w)[1 ] <= CONTROL_MAX) --> true
511+
499512 paramsSDP. infoStructure = " DH"
500513 @fact (get_control (modelSDP,paramsSDP,V_sdp3, 1 , x)[1 ] >= CONTROL_MIN) --> true
501- @fact (get_control (modelSDP,paramsSDP,V_sdp3, 1 , x)[1 ] >= CONTROL_MIN ) --> true
514+ @fact (get_control (modelSDP,paramsSDP,V_sdp3, 1 , x)[1 ] <= CONTROL_MAX ) --> true
502515
503516 @fact size (stocks_sdp) --> (3 ,1 ,2 )
504517 @fact size (controls_sdp) --> (2 ,1 ,2 )
0 commit comments