I am trying to solve the basic resource constrained project scheduling problem with discounted cash flow (RCPSPDC) that aims to maximize the net present value of the project by scheduling the activities with satisfying the precedence and resource constraint. I am struggling to code the resource constraint and precedence constraint. Although I have coded the resource constraint and precedence constraint, however I am not sure that I am coded correctly. Moreover, when I run the program there is an error message “Endogenous function argument (s) not allowed in linear models”.
I have attached the problem description and the gms files.
I am using GAMS Version: 30.3.0 64 bit/MS Windows.
Is there any one who can help me to solve the problem? rcpspdc.pdf (6.08 MB) rcpspdc.gms (1.76 KB)
Hi Renger,
Thanks for your reply. However, I have not understand why and how will I use log in my objective function?
Would you please explain it?
One more thing, I used MIP at first, but as there is a exponential function in the objective thus I run the code using NLP. Now there is no error message like “Endogenous function argument (s) not allowed in linear models”. But, the program has not given the correct output. Probably, I have not written the precedence and resource constraint correctly. Actually, I don’t know how to write the precedence and resource constraint. Moreover, I am wondering is there any better way to represent the precedence relationship? Please have a look on the program and help me if you can.
Thanks again.
Hi
Gams is complaining because you use the function exp(x). Maximizing exp(x) is the same as maximizing the log(exp(x)) = x and you get rid of the exp-function.
You have to check your model formulation. The resource constraint is not linked to any variable, so in fact you can just drop it. The model solves but this is probably not what your are looking for.
Hi
Maximizing exp(x) is the same as maximizing the log(exp(x)) = x (Gams was complaining because you were not allowed to use the exp(x) function).
The resource constraint in your model is not linked to any variable and can be dropped. Then the model solves, but this is probably not what you want. Check your model formulation and see how the resource constraint should be linked to other variables of the model.
Cheers
Renger
I have solved my problem. You are right that it was needed to link with any variable in the resource constraint.
However, I have solved my problem using the exp(x) function and got the desired result. I am using GAMS version 30.3.0 64 bit, that allows the use of exp(x) function. May be the old version of GAMS does not allowed to use the exp(x) function.