/******************************************************** Xpress-BCL Java Example Problems ================================ file xbexpl1.java ````````````````` BCL user guide example. Definition of variables and constraints, variable arrays and SOS, followed by file output, solving and printing of solutions. (c) 2008 Fair Isaac Corporation author: S.Heipcke, Jan. 2000, rev. Dec. 2011 ********************************************************/ import java.io.*; import com.dashoptimization.*; public class xbexpl1 { /**************************************************************************/ /* Expl 1: This example corresponds to the one printed in the */ /* BCL User Guide. It shows how to define variables and */ /* constraints, and Special Ordered Sets, followed by file output, */ /* solving and printing of solutions. */ /* Set the following parameter to true to try out a problem formulation */ /* using Special Ordered Sets: */ static final boolean SOS = false; /**************************************************************************/ static final int NJ = 4; /* Number of jobs */ static final int NT = 10; /* Time limit */ /**** DATA ****/ static final double[] DUR = {3,4,2,2}; /* Durations of jobs */ static XPRBvar[] start; /* Start times of jobs */ static XPRBvar[][] delta; /* Binaries for start times */ static XPRBvar z; /* Maximum completion time (makespan) */ static XPRBsos[] set; /* Sets regrouping start times for jobs */ /*************************************************************************/ static void jobsModel(XPRBprob p) throws IOException { XPRBexpr le; int j,t; /****VARIABLES****/ start = new XPRBvar[NJ]; /* Create start time variables */ for(j=0;j