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.c, xbworkrng.c


xbworks.c
/********************************************************
  BCL Example Problems
  ====================

  file xbworks.c
  ``````````````
  Workshop planning example.

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

#include 
#include "xprb.h"

#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;
 XPRBctr c; 
 XPRBvar x[NProd];                   /* Amount of product p */
 XPRBprob prob;

 prob=XPRBnewprob("Workshop");       /* Initialize a new problem in BCL */

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

xbworkrng.c
/********************************************************
  BCL Example Problems
  ====================

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

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

#include 
#include "xprb.h"

#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;
 XPRBctr c[NShop],cobj; 
 XPRBvar x[NProd];                   /* Amount of product p */
 XPRBprob prob;

 prob=XPRBnewprob("Workshop");       /* Initialize a new problem in BCL */

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