How to run a GPR file in Java API and run a model

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
allanh1193
User
User
Posts: 1
Joined: 1 year ago

How to run a GPR file in Java API and run a model

Post by allanh1193 » 1 year ago

Hello everybody.
I want to say in first place I'm new in the world of GAMS.
I have a model with GMS extension. When I run that model with Gams studio, it run perfectly and I obtain the expected results.
I have tried to run the GMS model with Gams IDE but I obtain a lot of errors, so, I have tried something different. I Have opened a file with GPR extension and later of that I have imported the GMS model and everything works perfectly
I think I need to do the sema doing use of Gams API from Java, but I don't know how to import to my workspace a GPR file.
In this moment I just have the next code:

Code: Select all

		GAMSWorkspace workspace = new GAMSWorkspace();
		workspace.setDebugLevel(DebugLevel.KEEP_FILES);
		GAMSJob jobGams = workspace.addJobFromFile("fileModelGms");
		jobGams.run();
When I run that code, I obtain an error:
GAMS process returns unsuccessfully with return code : 2 [there was a compilation error]. Check \\_gams_java_gjo1.lst] for more details.
I have searched in Documentation but I have not found anything about GPR extension.

Thanks.

Post Reply