[Cmpl] some CMPL errors

Anna Tarantini anna.tarantini at hotmail.it
Wed Apr 30 11:24:27 EDT 2014


Hi, we're trying to formulate a simple model to get the layout of a MAN. While compiling the CMPL we get some errors:
error(compiler): file prova.cmpl line 55: syntax error, unexpected SYMBOL_VARerror(compiler): file prova.cmpl line 64: syntax error, unexpected ASSIGN_ITER, expecting ':'error(compiler): file prova.cmpl line 64: syntax error, unexpected '}', expecting end of file
here's the CMPL file 


%arg -ignoreZeros


parameters:
f:=30;alfa:=40;r:=(1,2,3,4,5);beta:=20;omega:=10;
seed:=srand(100);	M:=10000;
	nrOfCities:=5;	NODES:=1..nrOfCities;
	{i in NODES:		  xp[i]:=rand(100);		  yp[i]:=rand(100);	}
	{i in NODES, j in NODES:	    {i==j: 		dist[i,j]:=M; |	    default: 		dist[i,j]:= sqrt( (xp[i]-xp[j])^2 + (yp[i]-yp[j])^2 );		dist[j,i]:= dist[i,j]+rand(10)-rand(10);	    }	}

#include "istanza0.cmpl"

variables:


w[NODES, NODES]: integer[0..];
y[NODES, NODES]: integer[0..1];
x[NODES, NODES]: integer[0..];


objectives:


cost: (sum{j:=1..nrOfCities : sum{i:=1..(j-1):  y[i,j] }} * f) +           (alfa * sum{j:=1..nrOfCities: sum{i:=1..(j-1):  d[i,j] * w[i,j] }}) -> min;



constraints:
strands { i in NODES, j in NODES : w[i,j] <= k * y[i,j]; }
flow  { j in NODES-1 : sum{ j in NODES, i in NODES : x[j,i] } - sum{ i in NODES, j in NODES : x[i,j] } = r[j] * beta; }
hubFlow  { j in NODES-1 : sum{ j in NODES : x[j, NODES] } - sum{ j in NODES : x[NODES,j] } = - sum{ j in NODES-1 : r[j] * beta }; }
capacity { i in NODES, j in NODES : x[j,i] + x[i,j] <= w[i,j] * omega; }


Any clue of how to resolve those errors?Greetings
Anna 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20140430/f8b2fd6f/attachment.html>


More information about the Cmpl mailing list