/******************************************************** Xpress-BCL Java Example Problems ================================ file xbburg.java ```````````````` Burglar problem, binary variable formulation. (c) 2008 Fair Isaac Corporation author: S.Heipcke, Jan. 2000, rev. Mar. 2011 ********************************************************/ import com.dashoptimization.*; public class xbburg { static final int NItems = 8; /* Number of items */ /****DATA****/ /* Item: 1 2 3 4 5 6 7 8 */ static final double[] VALUE = {15,100, 90, 60, 40, 15, 10, 1}; /* Value of items */ static final double[] WEIGHT = { 2, 20, 20, 30, 40, 30, 60, 10}; /* Weight of items */ static final double WTMAX = 102; /* Max weight allowed for haul */ public static void main(String[] args) { XPRBvar[] x; XPRBexpr lobj, kn; int i; try (XPRBprob p = new XPRBprob("Burglar")) { /* Initialize BCL and create a new problem */ /****VARIABLES****/ x = new XPRBvar[NItems]; /* 1 if we take item i; 0 otherwise */ for(i=0;i