JAMS Pre processing failed Topic is solved

Problems with syntax of GAMS
Post Reply
omarrossan
User
User
Posts: 9
Joined: 10 months ago

JAMS Pre processing failed

Post by omarrossan »

Hello Everyone,
I am trying to solve a bi-level optimisation problem using GAMS but I keep getting the following error,
*** EMP syntax error: key expected: is Wind_Output (item 1 on line 1)
--- EMP Summary
Logical Constraints = 0
Disjunctions = 0
Adjusted Constraint = 0
Flipped Constraints = 0
Dual Variable Maps = 0
Dual Equation Maps = 0
VI Functions = 0
QVI Parameters = 0
Equilibrium Agent = 0
Bilevel Followers = 0
I have checked the file of 225a directory (empinfo.dat) and could not figure out the issue.

I need your kind help to solve this error as it is very urgent, thanks in advance!
I will upload the file 225 and my code, so please any help to identify the error.
Attachments
empinfo.zip
(345.58 KiB) Downloaded 156 times
Fifth Draft.gms
(9.53 KiB) Downloaded 167 times
User avatar
dirkse
Moderator
Moderator
Posts: 215
Joined: 7 years ago
Location: Fairfax, VA

Re: JAMS Pre processing failed

Post by dirkse »

Hello,

Your EMP info file is not proper. It must start with a keyword, not a variable or equation name.

In the docs for bilevel models there are two examples (bard511 and ccmg71).

https://gams.com/latest/docs/S_JAMS.htm ... L_PROGRAMS

Each example includes a link to the complete model in the EMP model library and also some code fragments illustrating how the EMP info file looks. You'll also find more details there about what the keywords are and how to use them.

-Steve
omarrossan
User
User
Posts: 9
Joined: 10 months ago

Re: JAMS Pre processing failed

Post by omarrossan »

Hello,
Thank you for your response! I just want to let you know that I have followed the documentation published prepared by GAMS in this regard [https://www.gams.com/latest/docs/UG_EMP ... _EMPSyntax] (https://gams.com/latest/docs/S_JAMS.htm ... L_PROGRAMS), but it still does not work.

I have a Bi-level Problem of the following specifications and I have defined the solve statement as in the attached picture according to the guidelines:
Upper-Level Problem: ObjOut1,, ObjOut2
Upper-Level Problem - Decision Variables: P_RTP(i,k), P_ToU(j,k), PV_Out(k), Wind_Out(k), Con_Out(k)
Upper-Level Problem: ObjIn
Upper-Level Problem - Decision Variables: D_RTP(i,k), D_ToU(j,k)
Constraints: Balance_Constraint(k), PV_Constraint(k), Wind_Constraint(k), Conv_Constraint(k)

As you can see in the above photo, I have added the keyword Bi-level and then the decision variables. However, I still receive the same error, so could you please advise?

Attached the code to help you re-produce the error.

Looking forward to your reply,
Kind regards,
Omar
Attachments
Fifth Draft.gms
(10.91 KiB) Downloaded 162 times
GAMS error.png
User avatar
dirkse
Moderator
Moderator
Posts: 215
Joined: 7 years ago
Location: Fairfax, VA

Re: JAMS Pre processing failed

Post by dirkse »

Hello,

You are getting closer. Have a look at the transbp model in EMPLIB: it demonstrates the use of indexed equation and variable symbols in the EMP info file.

The EMP info file in that example looks like this:

bilevel
min z x cost supply demand
vi extdem g

with no index sets with the equation and variable symbols.

-Steve
omarrossan
User
User
Posts: 9
Joined: 10 months ago

Re: JAMS Pre processing failed

Post by omarrossan »

Hi Steve,

Thank you very much! the problem has been solved, much appreciated!
I just have one question, does the solve statement have to include all the equations defined in the model or just the equations that represent the constraints of the model? This is because I have equations to calculate some variables.

Kind regards,
Omar
User avatar
dirkse
Moderator
Moderator
Posts: 215
Joined: 7 years ago
Location: Fairfax, VA

Re: JAMS Pre processing failed

Post by dirkse »

Omar,

This seems like a trick question. The solve statement does not include any equations. For example:

Code: Select all

solve myMod using emp min z;
contains no equations and only one variable.

-Steve
Post Reply