I have a NLP model written in GAMS and I would like to use ROI (R Optimisation Interface) to send it to the NEOS Server.
It looks like ROI_read() is the command for reading in external models, but I don't know how to find out or install the correct reader type/plugin.
Sys.setenv(ROI_LOAD_PLUGINS = FALSE)
library(ROI) # ROI_solve
library(ROI.plugin.neos) # NEOS
x <- ROI_read("rawdata/mymodel.gms", type = "GAMS", solver = "neos")
Error in ROI_read("rawdata/mymodel.gms", type = "GAMS", solver = "neos") :
no reader found for type 'GAMS'
ROIdoesn't have a method for reading GAMS models. What it does when sending a model to the NEOS server it is writing the model as GAMS format and sending this file.Suppose you have the following model saved as
model.gmsThen you could modify the
solve_opfunction fromROI.plugin.neosin the following way to achieve what you want.The drawback of this approach is that the default printing method of
ROIfor the solution won't work any longer and that you have to select the solvermanually.A better approach would be to save the model in GAMS to fixed MPS format or any other format which
ROIcan actually read.