SCIP write best feasible solution in automated test

末鹿安然 提交于 2019-12-11 18:08:10

问题


Based on steps in http://scip.zib.de/doc/html/TEST.php, I have managed to set up an automated test using SCIP. However, I'd like to write the solution (best feasible solution) to a file, instead of just getting the objective value. Is there anyway to do it in the automated test?

I did a hack in check.sh by replacing

OPTCOMMAND=optimize; write solution myfilename.sol;

But too bad, it doesn't seem to work, when I tried to make TEST=mytest test, this line is observed from the output

 bash ./check.sh mytest bin/scip-3.1.0.linux.x86_64.gnu.opt.spx default scip-3.1.0.linux.x86_64.gnu.opt.spx 3600 2100000000 6144 1 default 10000 false false 3.1.0 spx false /tmp optimize;
 write: solution is not logged in on myfilename.sol

I know it is possible to write the solution via interactive shell, but I am trying to automate the test in order to retrieve both solution and obj value. Any help or clarification will be much appreciated!


回答1:


You are getting an error because with the syntax you are using, you try to invoke a bash command called "write" because of the semicolon:

The write utility allows you to communicate with other users, by copying lines from your terminal to theirs.

Just try without semicolon ;)

The cleaner solution would be to modify the file "check/configuration_tmpfile_setup_scip.sh" and add the line

echo write solution /absolute/path/to/solutions/${INSTANCE}.sol >> $TMPFILE

before the quit command. This configuration file sets up a batch file to feed SCIP with all commands that the interactive shell should execute, and you can model arbitrary user behavior.



来源:https://stackoverflow.com/questions/26489055/scip-write-best-feasible-solution-in-automated-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!