[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Building a Contract Scenario
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Building a Contract Scenario |
Date: |
Thu, 03 Aug 2017 09:39:33 +0300 |
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
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] Building a Contract Scenario,
Andrew Makhorin <=