Re: Building a Contract Scenario

Andrew Makhorin <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <1501742373.3798.4.camel@corvax>
On Wed, 2017-08-02 at 16:11 -0400, Peter Quincy Ng wrote:
> Hello,
> Thank you for your previous response it was quite helpful. I am having
> trouble with another problem and wasn't able to find this in the GLPK
> GNU manual.
> 
> So, I have a contract scenario where I want to start and end contracts
> to meet demand. My problem is that I want to list the long-term
> contracts so that meet demand over several days, but cannot be started
> on certain days, so the value for long-term will be zero.
> 
> So I have this dataset:
> 
> set DATES :=
> 
> 4.01
> 4.02
> 4.03
> 4.04
> 4.05
> 4.06
> 4.07
> 4.08
> 
> And have the following demand:
> 
> param NumDemand :=
> 
> 4.01  0
> 
> 4.02  1
> 
> 4.03  5
> 
> 4.04  2
> 
> 4.05  0
> 
> 4.06  1
> 
> 4.07  9
> 
> 4.08  12
> 
> So I have a constraint where short-term contracts and long-term
> contracts must meet demand so:
> 
> ShortTerm + LongTerm >= NumDemand
> 
> But long terms can only start on 4.03 to 4.06, so I need to put the
> values for 4.01, 4.02, 4.07 and 4.08 when I optimize.

I think you need to define two sets of dates: one for long-term and
other for short-term contracts, and then use them as indexing sets.

[Please post your questions to the help-glpk list, not to me.]

> 
> I hope that makes sense,
> 
> Thanks,
> Peter
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.