waelrash1 / or-tools

Automatically exported from code.google.com/p/or-tools
0 stars 1 forks source link

the .NET web project throw error when try to optimize more than 5000 row data uploaded from excel #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I am new to google or-tools

 I built a .NET web optimization tool by using google or-tools.

It allow user to upload data in excel format and select the column as 
objective(Max/Min) and set the constraints.

everything works well when the number of rows in excel is less than 5000. when 
I try it with 5000 rows data in excel, it throws the error: Cannot evaluate 
expression because the current thread is in a stack overflow state.

Here is the code to set the objective:

LinearExpr totalSumGoal = new LinearExpr();
            for (int i = 0; i < lstProject.Count; i++)
            {
                var dict = (IDictionary<string, object>)lstProject[i];
                totalSumGoal += lstDecision[i] * Convert.ToDouble(dict[objective.Right].ToString());
            }

            if (objective.Oper == "Max")
            {
                solver.Maximize(totalSumGoal);
            }
            else
            {
                solver.Minimize(totalSumGoal);
            }

Can you please point out what problem it might be?

I have attached the project.

My objective is to Maximum the Revenue.
the decision is to include or exclude the project.

without the constraints, all the projects should be included.

Original issue reported on code.google.com by haitao.t...@gmail.com on 14 Oct 2014 at 11:58

Attachments: