/********************************************************
Xpress-BCL Java Example Problems
================================
file xbworks.java
`````````````````
Workshop planning example.
(c) 2008 Fair Isaac Corporation
author: S.Heipcke, Jan. 2000, rev. Mar. 2011
********************************************************/
import com.dashoptimization.*;
public class xbworks
{
static final int NProd = 2; /* Number of products */
static final int NShop = 3; /* Number of workshops */
static final int WMAX = 40; /* Maximum weekly working time */
/****DATA****/
static final int[][] DUR = {{5, 9, 7},
{10, 2, 5}}; /* Duration of product p on shop s */
static final int[] RES = {10, 8}; /* Man hours per unit */
static final int[] PRICE = {108, 84}; /* Selling price per unit */
/***********************************************************************/
public static void main(String[] args)
{
int p,s;
XPRB bcl;
XPRBexpr l;
XPRBvar[] x; /* Amount of product p */
XPRBprob pb;
bcl = new XPRB(); /* Initialize BCL */
pb = bcl.newProb("Workshop"); /* Create a new problem in BCL */
/****VARIABLES****/
x = new XPRBvar[NProd];
for(p=0;p |
/********************************************************
Xpress-BCL Java Example Problems
================================
file xbworkrng.java
```````````````````
Workshop planning example.
Test ranges and number printing format.
(c) 2008 Fair Isaac Corporation
author: S.Heipcke, 2003, rev. Mar. 2011
********************************************************/
import com.dashoptimization.*;
public class xbworkrng
{
static final int NProd = 2; /* Number of products */
static final int NShop = 3; /* Number of workshops */
static final int WMAX = 40; /* Maximum weekly working time */
/****DATA****/
static final int[][] DUR = {{5, 9, 7},
{10, 2, 5}}; /* Duration of product p on shop s */
static final int[] RES = {10, 8}; /* Man hours per unit */
static final int[] PRICE = {108, 84}; /* Selling price per unit */
/***********************************************************************/
public static void main(String[] args)
{
int p,s;
XPRB bcl;
XPRBexpr l;
XPRBvar[] x; /* Amount of product p */
XPRBprob pb;
XPRBctr[] c;
bcl = new XPRB(); /* Initialize BCL */
pb = bcl.newProb("Workshop"); /* Create a new problem in BCL */
/****VARIABLES****/
x = new XPRBvar[NProd];
for(p=0;p |