Unable to understand the contents of Targetrunner.bat

40 views
Skip to first unread message

Tanya Aggarwal

unread,
Jun 4, 2023, 11:51:04 AM6/4/23
to The irace package: Iterated Racing for Automatic Configuration
Hi Manuel,

Hope you're well

I am conducting a research on Vehicle route optimisation problem as part of my dissertation. I have a csv file dataset that looks like this:
2023-06-02.png
I have multiple instance id's in the same csv file. My objective function is to reduce the cost by finding the right weights (any real number) for the heuristics (solver_id).
So I can assign 0 or a lower number to the solvers which do not contribute a lot to the optimisation process and a higher number or higher weightage to the solvers which are more dominant in the optimisation process. 
I have split this data.csv into test.csv and train.csv by 3:7 and have put both the files in .\Instances folder.
My parameters.txt file looks something like this:
2023-06-02 (1).png
Now I am unable to understand what to write in my targetrunner file to minimize the cost. I am really stuck on this and the ACOTSP example isn't helping for csv files. Is it compulsory to take txt files as instances? What should be my input and the code in targetrunner? (I am working in windows)

Hoping to receive a reply urgently as my submission deadline is next week.

Thank you in advance,  Manuel!

Best Regards
Tanya

Manuel López-Ibáñez

unread,
Jun 4, 2023, 11:58:12 AM6/4/23
to The irace package: Iterated Racing for Automatic Configuration
Hi Tanya,

I don't completely understand your scenario. Typically, you will have a solver, for example, 'vrp_solver.exe' that can be called with parameters and an input instance like:

'vrp_solver.exe' --param1 0.2347 --param2 0.5412 --instance ASL07 --seed 131429342389

and it will return a cost metric to be minimized. The goal of irace is to find the values of the parameters that minimizes the cost metric over the set of instances. Thus, the target-runner is a script or executable that takes care of calling your 'vrp_solver.exe' and collecting the cost value and returning it to irace.

If you have a .CSV with the cot values of many runs of the solver over many instances, then you do not need irace. You can calculate the best parameter values by reading the data and doing some basic calculations.

Best wishes,

Manuel.

Tanya Aggarwal

unread,
Jun 11, 2023, 7:29:32 PM6/11/23
to The irace package: Iterated Racing for Automatic Configuration
Hi Manuel,

I'm really sorry for the confusion. 
I have a SamplingSimulator.jar file that's an executable java solver. How should my targetrunner be modified to be able to run a java file to minimise costs?

Best Regards
Tanya

Manuel López-Ibáñez

unread,
Jun 11, 2023, 7:46:30 PM6/11/23
to The irace package: Iterated Racing for Automatic Configuration
Hi Tanya,

There are mostly 3 options:

1. If you know some R, you can call Java from R: https://cran.r-project.org/web/packages/rJava/index.html
Using that package, write a targetRunner function that calls your executable directly: See 5.2.2 Target runner R function in the user-guide: https://cran.r-project.org/web/packages/irace/vignettes/irace-package.pdf

I don't have an example for rJava, but here there is an example using matlabr: https://github.com/MLopez-Ibanez/irace/blob/master/inst/examples/matlab/scenario.txt

2. Otherwise,  write a BAT file (in Windows) or a Shell file (in Linux/Mac) that calls your executable using java -cp SamplingSimulator.jar PARAMETERS
and parses the result. You can see an example (using a shell script) here: https://github.com/jMetal/jMetal/blob/main/jmetal-auto/src/main/resources/irace/target-runner-AutoNSGAIIIraceHV

3. If you are more comfortable with Java than with R or BAT files, it may be easier to write an executable target-runner.jar wrapper that parses the command-line parameters in the order that irace sends them then calls the functions in SamplingSimulator.jar. See 5.2.1 Target runner executable program in the user-guide: https://cran.r-project.org/web/packages/irace/vignettes/irace-package.pdf

I don't have an example of this option but it is basically writing a Java program that behaves like a target-runner.

Please let me know which option worked for you. It would be great to have an example for other users in the package repository.

Best wishes,

Manuel.
Reply all
Reply to author
Forward
0 new messages