|
Model solution status attributes: .Modelstat, .Solvestat, .Tmodstat, .Tsolstat |
Top Previous Next |
|
The attributes of models may be included in a put employing the syntax
Put modelname.attribute
The blue entries below involves the modelstat and solvestat model attributes plus their text counterparts (Tmodstat, Tsolstat) reporting model and solver solution status as used within the example putex1.gms.
loop(scenarios, Need(Destinaton)=demandscen(destinaton,scenarios); Solve tranport using LP minimizing totalcost ; report("total","cost",scenarios)=totalcost.l; report("demand shadow price",Destinaton,scenarios) = demandbal.m(Destinaton); report("supply shadow price",Source,scenarios) = Supplybal.m(Source); savtransport(Source,Destinaton,scenarios) =transport.l(Source,Destinaton); put 'Scenario name ' scenarios.te(scenarios):14 put ' Optimality status ' tranport.modelstat:2:0 /; put ' Optimality status text ' tranport.Tmodstat /; put ' Solver status ' tranport.solvestat:2:0 /; put ' Solver status text ' tranport.Tsolstat /; ) ;
The resultant output file follows with the blue entries corresponding to the model solution status attribute data generated by the put commands above.
Scenario name Base Case Optimality status 1 Optimality status text 1 OPTIMAL Solver status 1 Solver status text 1 NORMAL COMPLETION Scenario name No Chicago Optimality status 1 Optimality status text 1 OPTIMAL Solver status 1 Solver status text 1 NORMAL COMPLETION Notes:
|