You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, communication with MATLAB is slow, requires editing R files and quite cumbersome and fragile. How to fix this?
Figure out what is the best way to communicate to MATLAB the information that irace generates. Currently, we use:
matlab_function_call<-"Main(INSTANCE,SEED,A,B)"args<- paste0(names(configuration), "=", configuration, collapse=";")
exitcode<-matlabr::run_matlab_code(
# This is the instance and seed
c(paste0("INSTANCE='", instance, "';SEED=", seed),
# The configuration parameters,args, matlab_function_call),
paths_to_add=matlab_script_path,
verbose= (debugLevel>=2))
The above assumes that there are 2 parameters A and B. If the parameters are different, then the above code must be edited.
This is not very flexible, because the user has to create such a function Main() with the precise parameters, but I don't know what would be a better way. Is there a way to call a MATLAB function with a variable number of parameters?
I think using R.matlab package to send/receive data from/to MATLAB would be much better than using matlabr.
Figure out what is the best way to collect the output given by MATLAB. Currently, we read the output like:
## Parse the output (just a single number!)
# FIXME: Create a uniquely named temporary file instead of Result.txt to
# allow parallel execution
output <- scan(file="Result.txt", quiet=TRUE)
cost <- as.numeric(output)
That is the function Main() in MATLAB must save the output to a file Result.txt, which irace reads. The above is slow and very unflexible. Ideally we would be able to call MATLAB and get the output directly without any extra files, but I don't know how to do that. Maybe possible with the R.matlab package mentioned above.
Once the above is figured out, create an R package tunematlab that contains a function: irace_matlab_runner(). And in scenario.txt you would just specify "targetRunner="matlab" and irace will load the tunematlab package and use the irace_matlab_runner() function to call matlab in the right way. This is the easy part.
The text was updated successfully, but these errors were encountered:
Currently, communication with MATLAB is slow, requires editing R files and quite cumbersome and fragile. How to fix this?
which uses the matlabr package to run the code:
The above assumes that there are 2 parameters A and B. If the parameters are different, then the above code must be edited.
This is not very flexible, because the user has to create such a function Main() with the precise parameters, but I don't know what would be a better way. Is there a way to call a MATLAB function with a variable number of parameters?
There is another package: https://cran.r-project.org/web/packages/R.matlab/index.html
I think using R.matlab package to send/receive data from/to MATLAB would be much better than using matlabr.
That is the function Main() in MATLAB must save the output to a file Result.txt, which irace reads. The above is slow and very unflexible. Ideally we would be able to call MATLAB and get the output directly without any extra files, but I don't know how to do that. Maybe possible with the R.matlab package mentioned above.
The text was updated successfully, but these errors were encountered: