[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Multi problems in GMPL
From: |
Domingo Alvarez Duarte |
Subject: |
Multi problems in GMPL |
Date: |
Wed, 26 Aug 2020 19:57:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello !
Thinking in how to have multiple problem in GMPL I'm asking for other
user opinions about how that could be expressed, one example can be like
the one bellow where we have common elements and namespaced problems.
If you have any other idea that you want to share let me know !
====
param roll_width;
set WIDTHS;
problem Cutting_Opt {
# ----------------------------------------
param nPAT integer >= 0, default 0;
set PATTERNS := 1..nPAT;
param orders {WIDTHS} > 0;
param nbr {WIDTHS,PATTERNS} integer >= 0;
check {j in PATTERNS}: sum {i in WIDTHS} i * nbr[i,j] <= roll_width;
var Cut {PATTERNS} integer >= 0;
minimize Number: sum {j in PATTERNS} Cut[j];
subject to Fill {i in WIDTHS}:
sum {j in PATTERNS} nbr[i,j] * Cut[j] >= orders[i];
}
problem Pattern_Gen {
# ----------------------------------------
param price {WIDTHS} default 0;
var Use {WIDTHS} integer >= 0;
minimize Reduced_Cost:
1 - sum {i in WIDTHS} price[i] * Use[i];
subject to Width_Limit:
sum {i in WIDTHS} i * Use[i] <= roll_width;
}
solve Cutting_Opt;
solve Pattern_Gen;
====
Cheers !
- Multi problems in GMPL,
Domingo Alvarez Duarte <=