Hello

> 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
http://en.wikibooks.org/wiki/GLPK/Using_GLPSOL#Passing_values_via_the_command_line

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

Create a batch file test.bat

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

Linux
#!/bin/sh
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

Xypron
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to