[Top][All Lists]

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

Re: [Help-glpk] Argument with glpsol

From: glpk xypron
Subject: Re: [Help-glpk] Argument with glpsol
Date: Tue, 18 Jan 2011 17:47:28 +0100


> is there any way to give an int parameter with
> glpsol (in command prompt) and then use this as a param (or variable)
> in .mod-file?

I added the following example to

Create a model file test.mod
param p;
printf "p = %f\n",p;

Create a batch file test.bat

echo data;param p := $1;end; > test.dat
glpsol.exe -m test.mod -d test.dat

echo data\;param p := $1\;end\; > test.dat
glpsol -m test.mod -d test.dat

For Linux only the shell script has to made execuatble.
chmod 755 test.bat

Execute the batch file
./test.bat 3.14159

Observe that you can specify multiple data files e.g.
glpsol -m test.mod -d 1.dat -d 2.dat -d 3.dat

Best regards

Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren:

reply via email to

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