1package com.gams.examples.cutstock;
4import java.util.HashMap;
6import java.util.Map.Entry;
21 public static void main(String[] args) {
27 File workingDirectory =
new File(System.getProperty(
"user.dir"),
"SimpleCutstock");
28 workingDirectory.mkdir();
36 Map<String, Double> d =
new HashMap<String, Double>();
38 d.put(
"i1", Double.valueOf(97) );
39 d.put(
"i2", Double.valueOf(610) );
40 d.put(
"i3", Double.valueOf(395) );
41 d.put(
"i4", Double.valueOf(211) );
43 Map<String, Double> w =
new HashMap<String, Double>();
45 w.put(
"i1", Double.valueOf(45) );
46 w.put(
"i2", Double.valueOf(36) );
47 w.put(
"i3", Double.valueOf(31) );
48 w.put(
"i4", Double.valueOf(14) );
53 for(String i : d.keySet())
56 for(Entry<String, Double> t : d.entrySet())
59 for(Entry<String, Double> t : w.entrySet())
67 System.out.println(rep.getKey(0) +
", pattern " + rep.getKey(1) +
": " + rep.getValue());
70 System.out.println(
"Problem in GAMS: " + e.
getMessage());
74 System.out.println(
"System Exception: " + e.
getMessage());
void setAllModelTypes(String value)
void setValue(double value)
T addRecord(Vector< String > keys)
void setSystemDirectory(String directory)
void setWorkingDirectory(String directory)
This example shows the wrapper model of a cutstock problem based on the simple GAMS [cutstock] model ...
GAMSSet getWidths()
get an input symbol, i : widths
GAMSParameter getDemand()
get an input symbol, d : demand
void run()
Executes the cutstock model.
GAMSParameter getPatRep()
get an output symbol, patrep : Solution pattern report
GAMSParameter getRawWidth()
get an input symbol, r : raw width
GAMSOptions getOpt()
get Options for the execution of the cutstock model
GAMSParameter getWidth()
get an input symbol, w : width
This example implements a column generation approach.
Provides package namespace for Java interface and examples to General Algebraic Model System (GAMS).