Hi there,

I was wrong before

This is the correct model

$Title A Land allocation Problem (SUIT,SEQ=1)

$Offupper

$Ontext

This problem finds best land use allocation of commercial, housing and recreation.

$Offtext

Sets

i cells / 1*9 /

j landuses / com, hous, rec / ;

Parameters

d(j) demand at market j in cases

/ com 4

hous 3

rec 2 / ;

Table s(i,j) suitabilities

com hous rec

1 17 3 12

2 6 12 3

3 6 15 43

4 42 9 9

5 5 13 6

6 4 16 18

7 1 8 24

8 7 12 13

9 5 7 19;

Variables

x(i,j) decision variable

z total suitability;

x.up(i,j) =1;

x.lo(i,j) =0;

Equations

suit define objective function

supply(i) observe supply limit at plant i

demand1(j) satisfy demand at market j

demand2(j) satisfy demand at market j

demand3(j) satisfy demand at market j ;

suit … z =e= sum((i,j), s(i,j)*x(i,j)) ;

supply(i) … sum(j, x(i,j)) =l=1 ;

demand1(j) {ord(j)=1} .. sum(i, x(i,j)) =l= d(j);
demand2(j) {ord(j)=2} … sum(i, x(i,j)) =e= d(j);

demand3(j) $ {ord(j)=3} … sum(i, x(i,j)) =g= d(j);

Model alloc /all/ ;

Solve alloc using lp maximizing z ;

Display x.l, x.m ;

On Wednesday, August 26, 2015 6:23 PM, ‘Tuong Nguyen Manh’ via gamsworld wrote:

Hi there,

use ’ instead of " will not fix the problem. In fact, there is nothing wrong with using ".

The issue is you have three different set of constraints (equations) but you only declare one equation demand(j)

To fix this problem, you need to declare 3 different sets of equations, see the code bellow:

$Title A Land allocation Problem (SUIT,SEQ=1)

$Offupper

$Ontext

This problem finds best land use allocation of commercial, housing and recreation.

$Offtext

Sets

i cells / 1*9 /

j landuses / com, hous, rec / ;

Parameters

d(j) demand at market j in cases

/ com 4

hous 3

rec 2 / ;

Table s(i,j) suitabilities

com hous rec

1 17 3 12

2 6 12 3

3 6 15 43

4 42 9 9

5 5 13 6

6 4 16 18

7 1 8 24

8 7 12 13

9 5 7 19;

Variables

x(i,j) decision variable

z total suitability;

x.up(i,j) =1;

x.lo(i,j) =0;

Equations

suit define objective function

supply(i) observe supply limit at plant i

demand1(j) satisfy demand at market j

demand2(j) satisfy demand at market j

demand3(j) satisfy demand at market j ;

suit … z =e= sum((i,j), s(i,j)*x(i,j)) ;

supply(i) … sum(j, x(i,j)) =l=1 ;

demand1(j) … sum(i, x(i,“com”)) =l=d(j);

demand2(j) … sum(i, x(i,“hous”)) =e=d(j);

demand3(j) … sum(i, x(i,“rec”)) =g=d(j);

Model alloc /all/ ;

Solve alloc using lp maximizing z ;

Display x.l, x.m ;

Hope this help.

Cheers

Tuong Nguyen

On Tuesday, August 25, 2015 8:07 PM, Mohammad Moshref Javadi wrote:

use ’ instead of "

On Sun, Aug 16, 2015 at 1:25 AM, ersin turk wrote:

Dear sir/madam,

I need your helps. There are problems in which written red, underlined and bold that solver was given errors. But I could not solve the problems.

Thank you for your helps.

Best regards.

$Title A Land allocation Problem (SUIT,SEQ=1)

$Offupper

$Ontext

This problem finds best land use allocation of commercial, housing and recreation.

$Offtext

Sets

i cells / 1*9 /

j landuses / com, hous, rec / ;

Parameters

d(j) demand at market j in cases

/ com 4

hous 3

rec 2 / ;

Table s(i,j) suitabilities

com hous rec

1 17 3 12

2 6 12 3

3 6 15 43

4 42 9 9

5 5 13 6

6 4 16 18

7 1 8 24

8 7 12 13

9 5 7 19;

Variables

x(i,j) decision variable

z total suitability;

x.up(i,j) =1;

x.lo(i,j) =0;

Equations

suit define objective function

supply(i) observe supply limit at plant i

demand(j) satisfy demand at market j ;

suit … z =e= sum((i,j), s(i,j)*x(i,j)) ;

supply(i) … sum(j, x(i,j)) =l=1 ;

demand(j) … sum(i, x(i,“com”)) =l=d(j)

sum(i, x(i,“hous”)) =e=d(j)

sum(i, x(i,“rec”)) =g=d(j);

## Model alloc /all/ ;

Solve alloc using lp maximizing z ;

Display x.l, x.m ;

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.