Viewing the solution
Always check the solution status of the problem before accessing any solution values.
if (getprobstat=XPRS_OPT) then writeln('optimal!') else writeln('not optimal!') exit(1) end-if
Alternatively, testing all problem states:
case getprobstat of XPRS_OPT: writeln('optimal') XPRS_INF: writeln('infeasible') XPRS_UNB: writeln('unbounded') XPRS_UNF: writeln('unfinished') else writeln('unexpected problem status!') end-case
Accessing the solution values within the model:
writeln('Maximum revenue: $', getobjval) writeln('x(1) = ', getsol(x(1)), ' x(2) = ', x(2).sol)
Solution values of constraints: activity value + slack value = RHS
-
MaxCap := 10*x + 20*y <= 30
- Activity value:
-
getsol(10*x + 20*y) getact(MaxCap)
- Slack value:
-
getsol(30 - (10*x + 20*y)) getslack(MaxCap)
Xpress Workbench: assuming that the model runs successfully, the logging pane at the bottom of the workspace reports that the run is complete. If a model has been run through the debugger, you can browse solution values of decision variables and constraints in the Debugger tab on the right side of the workspace.
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.