help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] [Fwd: [Fwd: Re: Initializing a few decision variables]]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: [Fwd: Re: Initializing a few decision variables]]
Date: Mon, 01 Aug 2011 21:39:08 +0400

-------- Forwarded Message --------
From: address@hidden
To: address@hidden
Subject: [Fwd: Re: [Help-glpk] Initializing a few decision variables]
Date: Mon, 1 Aug 2011 12:00:38 -0400

I added two arrays of equal dimensions to the set, FT and FS, and
initialized them in the data section
They hold the paired values for the initial assignments.
set FT :=    D1 B2 D2 B3 B1;
set FS :=     1  2  4  5  7;

I added the following statement to the model

s.t. init{f in FT,}: x[f,FS[f]] = 1;

the error is that FS cannot be subscripted.

Basic question remains on how to specify the initial assignment constraint
in the model section
and how to specify the pairs of initial assigments in the data section.
Thanks




if B1 is a set, you probably want to write:

s.t. {b in B1} c1 : x[b,21] = 1;
# or
s.t. c2 : x["b",21] = 1; # where "b" is a member of B1

Best regards

Xypron


On 29.07.2011 16:45, Marc Goetschalckx wrote:
> I am using a model coded in GMPL.
> The model has a large two-dimensional array of x variables, one
> dimension has literal indices that are defined in a set in the data
> segment (example is B1)
> This model is running and solving so far.
> However, I need to initialize a very few of the x variables because of
> boundary conditions.
> Statement in the model section is similar to
> s.t. x[B1,21]=1;
> This cannot be done because B1 is not yet defined (from the data
> section).
> How can I initialize some of the variables in the data section, or
> what is the sequence of actions that can achieve this.
> Thanks.
>








reply via email to

[Prev in Thread] Current Thread [Next in Thread]