# Cplex to solve discouted cash flow

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.cost*presenceOf(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

Hi! Can you point out how this is related to Sage? Sage does have an interface with CPLEX but I don't know if we can help too much with code for that straight up, as it is not a part of Sage, only something our MILP solver can use as a backend. Do you have some Python/Sage code that is causing problems you can update the question with? Thanks!