Initializing help system before first use

Workshop - Displaying solution information


Type: Production planning
Rating: 1
Description: A small planning problem. The example composes constraints, LP solves the problem and then prints the variables.
Model version 'xbworkrng' shows how to retrieve ranging information for variables and constraints and how to change the number-printing format.
File(s): xbworks.cxx, xbworkrng.cxx


xbworks.cxx
/********************************************************
  Xpress-BCL C++ Example Problems
  ===============================

  file xbworks.cxx
  ````````````````
  Workshop planning example.

  (c) 2008 Fair Isaac Corporation
      author: S.Heipcke, Jan. 2000, rev. Mar. 2011
********************************************************/

#include 
#include "xprb_cpp.h"

using namespace std;
using namespace ::dashoptimization;

#define NProd 2                  /* Number of products */
#define NShop 3                  /* Number of workshops */
#define WMAX 40                  /* Maximum weekly working time */ 

/****DATA****/
int DUR[][NShop] =  {{5, 9, 7},  /* Duration of product p on shop s */
                    {10, 2, 5}};
int RES[]   = {10, 8};           /* Man hours per unit */
int PRICE[] = {108, 84};         /* Selling price per unit */

/***********************************************************************/

int main(int argc, char **argv)
{
 int p,s;
 XPRBexpr l;
 XPRBvar x[NProd];               /* Amount of product p */
 XPRBprob pb("Workshop");        /* Initialize a new problem in BCL */

/****VARIABLES****/
 for(p=0;p

xbworkrng.cxx
/********************************************************
  Xpress-BCL C++ Example Problems
  ===============================

  file xbworkrng.cxx
  ``````````````````
  Workshop planning example.
  Test ranges and number printing format.

  (c) 2008 Fair Isaac Corporation
      author: S.Heipcke, 2003, rev. Mar. 2011
********************************************************/

#include 
#include "xprb_cpp.h"

using namespace std;
using namespace ::dashoptimization;

#define NProd 2                  /* Number of products */
#define NShop 3                  /* Number of workshops */
#define WMAX 40                  /* Maximum weekly working time */ 

/****DATA****/
int DUR[][NShop] =  {{5, 9, 7},  /* Duration of product p on shop s */
                    {10, 2, 5}};
int RES[]   = {10, 8};           /* Man hours per unit */
int PRICE[] = {108, 84};         /* Selling price per unit */

/***********************************************************************/

int main(int argc, char **argv)
{
 int p,s;
 XPRBexpr l;
 XPRBvar x[NProd];               /* Amount of product p */
 XPRBprob pb("Workshop");        /* Initialize a new problem in BCL */
 XPRBctr c[NShop];

/****VARIABLES****/
 for(p=0;p