# Cplex to solve discounted cash flow

 0 Hi, We are working on a project to consider discounted cashflow in MRCPSP problems. We are having trouble implementing discounted cash flow concept in our cost objective function. The actual code, not considering discouted cash flow is: minimize(sum(m in Modes)m.costpresenceOf(mode[m]))100 which minimizes the cost of the project .this function adds up all the cost related to each mode of activity.what we need is for each mode the function consider the cost and the finish schedule of each activity. rate = annual interest rate discounted cash flow= cost x (1-scheduled finish time of activity x rate) What we have tried is: minimize(sum(m in mode))m.cost(1-rate(m.Duration))presenceOf(mode[m]))100 which is not correct , and it considers the duration of activity what we need is finish time of activity to be calculated. Thank you very much for your help, Pernelle and Mehdi asked 18 Nov '14, 12:23 Pernindy 11●2 accept rate: 0%

 0 Have you looked at using the constraint programming solver that comes with CPLEX (CP Optimizer)? Here is a paper that uses it for MRCPSP. answered 19 Nov '14, 05:09 jfpuget 2.5k●3●10 accept rate: 8% Hi, Yes we are using CP optimizer and we have a code to solve MRCPSP problems. We don't know how to add the discounted cash flow. Thank you for the paper! :) Pernelle (19 Nov '14, 08:59) Pernindy
 0 Hello Pernelle, Using the notations of the Multi-Mode RCPSP model distributed with CP Optimizer, if your discounted cash flow formula does not depend on the mode but only on the task, I would model it doing something like: maximize sum(t in Tasks) t.profit * pow(1.0 + t.rate, - alpha*endOf(task[t]));  If the discounted cash flow formula depends on the mode, that would be something like: maximize sum(m in Modes) m.profit * pow(1.0 + m.rate, - alpha*endOf(mode[m],BigNumber));  Where BigNumber is a large enough number so that the profit gets close to zero when the mode is not selected. answered 26 Nov '14, 10:04 Philippe Lab... 62●3 accept rate: 9% Thank you very much for your help and your time! We have coded the discounted cash flow as follows: dexpr int c = max(t in Tasks) endOf(task[t]); range Days = 0..c; minimize (sum (m in Modes) m.cost * (1 - Rate (endOf(mode[m]))) * presenceOf(mode[m])) + InitialCost + ( sum(i in Days) IndirectCost * (1- Ratei)) + (( c - Deadline) >= 0 ? (( c - Deadline) * Penalty (1- Ratec)) : (( c - Deadline) * Incentive * (1- Rate*c))); It shows an error on the c present in the range. How can I model the range which goes from 1 to a variable "c" which takes a value from an expression previously in the code in cp optimizer ? CODE : Thanks. (26 Nov '14, 11:36) Pernindy Probably because of some missing characters in your formula, I have troubles parsing your cost function in detail. For instance what is: Rate(endOf(mode[m])) or Ratei ? Also, could you make it clear what is a constant and what is a variable ? What is clear is that in OPL you cannot use a range over a decision variable. And in general, if you are using a CP Optimizer model using interval variables, you should leverage the modeling concepts to avoid (if possible of course) the enumeration over each time value (sum(i in Days)). That is why I would like to see if there is a more direct formulation of your cost function that can directly work on the start/end/presence of your interval variables. (26 Nov '14, 12:05) Philippe Lab... We multiply the interest rate by the duration of each mode to have a "payment at completion model". (26 Nov '14, 13:58) Pernindy
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×191