1

I am using LPSolve from Java and I need to use a decimal constant value but it ignores the digits after the point.

For example: The follow lp model (in lp format):

max: 0.5 x1;
r_1: x1 <= 5;

It has an objective function's "optimal value" of 0 because it parses the objective function as max: 0 x1.

I am solving the model using:

LpSolve solver = LpSolve.readLp("pathToModel",1,"");
solverResult = solver.solve();

Can anyone tell me what I'm doing wrong?

Tibrogargan
  • 4,508
  • 3
  • 19
  • 38
fraverta
  • 75
  • 1
  • 13
  • Java may set the locale for the C runtime. I would try to set the locale to US before calling LPSolve. – Erwin Kalvelagen Jun 30 '16 at 12:48
  • Erwinm thanks for your answer. I add a line Locale.setDefault(Locale.US); before call to LPSolve but it doesn't fix the bug. Are there any other idea? – fraverta Jul 01 '16 at 13:49

0 Answers0