Overlapping row name

Hi,
I think I have done everthing correctly. but I got overlapping row name error
is it possible to guide me please?

this is my code:

$onecho > book3.txt
i=“%system.fp%mydata.xlsx”

r1=agri1!A1:AJQ1046
o1=“%system.fp%agri1.inc”

r2=jangaldar1!A1:AJQ1046
o2=“%system.fp%jangaldar1.inc”

r3=develop1!A1:AJQ1046
o3=“%system.fp%develop1.inc”

r4=range1!A1:AJQ1046
o4=“%system.fp%range1.inc”

$offecho
$call =xls2gms @book3.txt

sets
i row /11045/
j col /1
952/ ;

scalar agri1A /258664/;
scalar jangaldar1A /194013/;
scalar develop1A /64671/;
scalar range1A /129363/;

Table agri1(i,j) agriculture
$include “%system.fp%agri1.inc” ;

Table jangaldar1(i,j) forestry
$include “%system.fp%jangaldar1.inc” ;

Table develop1(i,j) develop
$include “%system.fp%develop1.inc” ;

Table range1(i,j) range
$include “%system.fp%range1.inc” ;

Variable
X(i,j) Indicate agriculture
Y(i,j) Indicate forestry
H(i,j) Indicate davelop
Q(i,j) Indicate range
TC
;
*Binary Variable x,G;
*Positive Variable x,G;
Positive Variables X,Y,H,Q;

Equation
cons0(i,j)
cons1
cons2
cons3
cons4
Obj
;
cons0(i,j)… X(i,j)+Y(i,j)+H(i,j)+Q(i,j) =l=1;
cons1… sum((i,j),X(i,j)) =e=agri1A;
cons2… sum((i,j),Y(i,j)) =e=jangaldar1A;
cons3… sum((i,j),H(i,j)) =e=develop1A;
cons4… sum((i,j),Q(i,j)) =e=range1A;

Obj… TC=e=sum((i,j),agri1(i,j)*X(i,j))+sum((i,j),jangaldar1(i,j)*Y(i,j))+sum((i,j),develop1(i,j)*H(i,j))+sum((i,j),range1(i,j)*Q(i,j));

Model AAA/all/;
option optca=0,optcr=0,reslim=72000,iterlim=1000000000;
SOLVE AAA using lp minimizing TC;

execute_unload “%system.fp%output.gdx” TC.l,X.l,Y.l,H.l,Q.l
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=TC.L rng=TC! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=X.L rng=X! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=Y.L rng=Y! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=H.L rng=H! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=Q.L rng=Q! o=“%system.fp%output.xlsx”’


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.

Hi
Please attach your data


✔ Get a Signature like this: Click Here!

On Sun, Nov 15, 2015 at 12:11 PM, fatema saeedi wrote:

Hi,
I think I have done everthing correctly. but I got overlapping row name error
is it possible to guide me please?

this is my code:

$onecho > book3.txt
i=“%system.fp%mydata.xlsx”

r1=agri1!A1:AJQ1046
o1=“%system.fp%agri1.inc”

r2=jangaldar1!A1:AJQ1046
o2=“%system.fp%jangaldar1.inc”

r3=develop1!A1:AJQ1046
o3=“%system.fp%develop1.inc”

r4=range1!A1:AJQ1046
o4=“%system.fp%range1.inc”

$offecho
$call =xls2gms @book3.txt

sets
i row /11045/
j col /1
952/ ;

scalar agri1A /258664/;
scalar jangaldar1A /194013/;
scalar develop1A /64671/;
scalar range1A /129363/;

Table agri1(i,j) agriculture
$include “%system.fp%agri1.inc” ;

Table jangaldar1(i,j) forestry
$include “%system.fp%jangaldar1.inc” ;

Table develop1(i,j) develop
$include “%system.fp%develop1.inc” ;

Table range1(i,j) range
$include “%system.fp%range1.inc” ;

Variable
X(i,j) Indicate agriculture
Y(i,j) Indicate forestry
H(i,j) Indicate davelop
Q(i,j) Indicate range
TC
;
*Binary Variable x,G;
*Positive Variable x,G;
Positive Variables X,Y,H,Q;

Equation
cons0(i,j)
cons1
cons2
cons3
cons4
Obj
;
cons0(i,j)… X(i,j)+Y(i,j)+H(i,j)+Q(i,j) =l=1;
cons1… sum((i,j),X(i,j)) =e=agri1A;
cons2… sum((i,j),Y(i,j)) =e=jangaldar1A;
cons3… sum((i,j),H(i,j)) =e=develop1A;
cons4… sum((i,j),Q(i,j)) =e=range1A;

Obj… TC=e=sum((i,j),agri1(i,j)*X(i,j))+sum((i,j),jangaldar1(i,j)*Y(i,j))+sum((i,j),develop1(i,j)*H(i,j))+sum((i,j),range1(i,j)*Q(i,j));

Model AAA/all/;
option optca=0,optcr=0,reslim=72000,iterlim=1000000000;
SOLVE AAA using lp minimizing TC;

execute_unload “%system.fp%output.gdx” TC.l,X.l,Y.l,H.l,Q.l
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=TC.L rng=TC! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=X.L rng=X! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=Y.L rng=Y! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=H.L rng=H! o=“%system.fp%output.xlsx”’
execute ‘gdxxrw.exe “%system.fp%output.gdx” var=Q.L rng=Q! o=“%system.fp%output.xlsx”’


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.

\

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.