Hello Manuel,
I hope you are well. I have two questions regarding the target function of the iRace algorithm, which I will explain below.
I have coded the target-runner in Python in order to link iRace (in RStudio) with my algorithm (coded in Matlab). I have included four text files in order to define:
(1) parameters: there is only one integer parameter (--nPop)
nPop "--nPop " i (100, 4000)
(2) configurations (I have introduced an initial value for --nPop)
nPop
800
(3) instances (I have defined the title of instances that must be passed to my Matlab codes)
# data1
# data2
# data3
1
2
3
(4) scenario.
The target runner must call the Matlab function with two input arguments: (1) --nPop and (2) the title of instances. Both of these input arguments must be double values.
For target runner, I have used the template target-runner.py file that is provided by iRace. As I understood, the iRace passes five input arguments to the target runner as follows:
configuration_id = sys.argv[1]
instance_id = float(sys.argv[2])
seed = sys.argv[3]
instance = sys.argv[4]
cand_params = sys.argv[5:]
In order to determine --nPop, I am using the below code:
while cand_params:
# Get and remove first and second elements.
param = cand_params.pop(0)
value = cand_params.pop(0)
if param == "--nPop":
nPop = float(value)
else:
target_runner_error("unknown parameter %s" % (param))
And for the instance number, I am passing float(instance_id) to the Matlab function. Would you please confirm that I am passing the correct information to my Matlab function?
Unfortunately, I do not know how to debug and check the input and output arguments of iRace and the target runner. Do you have any suggestions for me on how I can debug these scripts and see check whether they are working properly?
Many Many thanks, Amirhossein.