

Hello again,
I can't solve the error running the acotsp program with irace.
I followed theses steps (in Windows):
1) I got the ACOTSP (ACOTSP 1.04-tuning) project files and included them in a Eclipse C project.
2) I built an exe file by means of the MinGW compiler (I obtained the AcoTsp.exe file)
3) I executed this exe file:
AcoTsp.exe -i d198.tsp --alpha 0.5 --beta 0.6 --tours 20004) It is shown on the console iteration results. I.e.:
..........
try 9, Best 15790, found at iteration 5, found at time 0.1350000
t_avgbest = 4.357100
t_avgtotal = 10.010100 It seems there is not any problem in the run (you could find a more detailed result in the first image, at the top of this message).
5) I set the
target-runner.bat file modifiyng (ONLY) the exec line:
SET "exe=C:\Users\berna\Documents\doct\doct\irace\acotsp\2\acotsp-example\acotsp-example\AcoTsp.exe" But you could see the entire file in the following lines:
::##############################################################################
:: This script is the command that is executed every run.
:: Check the examples in examples/
::
:: This script is run in the execution directory (execDir, --exec-dir).
::
:: PARAMETERS:
:: %1 is the candidate configuration number
:: %2 is the instance ID
:: %3 is the seed
:: %4 is the instance name
:: The rest (%* after `shift 4') are parameters to the run
::
:: RETURN VALUE:
:: This script should print one numerical value: the cost that must be minimized.
:: Exit with 0 if no error, with 1 in case of error
::##############################################################################
@echo off
:: Please change the path to the correct one
:: SET "exe=D:\bin\acotsp"
SET "exe=C:\Users\berna\Documents\doct\doct\irace\acotsp\2\acotsp-example\acotsp-example\AcoTsp.exe"
SET "fixed_params=--time 20 --tries 1 --quiet"
SET candidate=%1
SHIFT
SET instance_id=%1
SHIFT
SET seed=%1
SHIFT
SET instance=%1
SHIFT
SET candidate_parameters=%*
SET "stdout=c%candidate%-%instance_id%.stdout"
SET "stderr=c%candidate%-%instance_id%.stderr"
::if not exist %exe% error "%exe%: not found or not executable (pwd: %(pwd))"
:: If the program just prints a number, we can use 'exec' to avoid
:: creating another process, but there can be no other commands after exec.
::exec %exe %FIXED_PARAMS% -i %instance %candidate_parameters%
:: exit 1
::
:: Otherwise, save the output to a file, and parse the result from it.
:: (If you wish to ignore segmentation faults you can use '{}' around
:: the command.)
%exe% %FIXED_PARAMS% -i %instance% --seed %seed% %candidate_parameters% 1>%stdout% 2>%stderr%
::if %errorlevel% neq 0 exit /b %errorlevel%
:: # This may be used to introduce a delay if there are filesystem
:: # issues.
:: SLEEPTIME=1
:: while [ ! -s "%stdout%" ]; do
:: sleep %SLEEPTIME
:: let "SLEEPTIME += 1"
:: done
::
:: This is an example of reading a number from the output.
:: It assumes that the objective value is the first number in
:: the first column of the last line of the output.
::if exist %stdout% (
setlocal EnableDelayedExpansion
set "cmd=findstr /R /N "^^" %stdout% | find /C ":""
for /f %%a in ('!cmd!') do set numberlines=%%a
set /a lastline=%numberlines%-1
for /f "tokens=3" %%F in ('more +%lastline% %stdout%') do set COST=%%F
echo %COST%
::del %stdout% %stderr%
exit 0
::) ELSE (
::exit /b
::)
6) I run the check command and the irace command, but there are some problems: In the second image at the top of this message, you can find a more detailed
information about this problem
irace --scenario scenario.txt
I run this sentence in the irace configuration files path
And finally, I have a doubt:
I read in The irace Package: User Guide document that
"the program targetRunner must print a real number,
which corresponds to the cost measure of the candidate configuration for the given instance
and optionally its execution time (mandatory when maxTime is used)". Then I suppose that the executable program (AcoTsp) must output ONLY a real number. But I noted ACOTSP program output more than a real number. Perhaps this error is happened because last sentences of
target-runner.bat cannot get properly the output of acotsp executable file.
I sorry for the inconvenience.
Thank you!
Bernardo.