01: // --------------------------------------------------------------------------
02: // Licensed Materials - Property of IBM
03: //
04: // 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55
05: // Copyright IBM Corporation 1998, 2013. All Rights Reserved.
06: //
07: // Note to U.S. Government Users Restricted Rights:
08: // Use, duplication or disclosure restricted by GSA ADP Schedule
09: // Contract with IBM Corp.
10: // --------------------------------------------------------------------------
11: 
12: {string} Products = { "gas", "chloride" };
13: {string} Components = { "nitrogen", "hydrogen", "chlorine" };
14: 
15: float Demand[Products][Components] = [ [1, 3, 0], [1, 4, 1] ];
16: float Profit[Products] = [30, 40];
17: float Stock[Components] = [50, 180, 40];
18: 
19: dvar float+ Production[Products];
20: 
21: maximize
22:   sum( p in Products ) 
23:     Profit[p] * Production[p];
24: subject to {
25:   forall( c in Components )
26:     ct:
27:       sum( p in Products ) 
28:         Demand[p][c] * Production[p] <= Stock[c];
29: }
30: 
31: 
32: 
33: 
34: 
35: