Yura
Yura

Reputation: 29

How to change some LPsolve parameters values through JAVA ILP?

I try to change some LP solve parameters values (setMipGap(), setEpsel())) to increasing the counting LP speed by reducing accuracy. The problem is that I also uses JAVA ILP interface (https://javailp.sourceforge.net/) to simplify the process of adding equations to Lpsolve.

I try to write such code, but receive a mistake:

public SolverFactoryLpSolve lpFactory = new SolverFactoryLpSolve(); 
LpSolve lpsolve = (LpSolve) lpFactory.get();        

lpsolve.setMipGap(true, 0.1);
lpsolve.setEpsel(0.1);

Mistake :

java.lang.ClassCastException: class net.sf.javailp.SolverLpSolve cannot be cast to class lpsolve.LpSolve (net.sf.javailp.SolverLpSolve and lpsolve.LpSolve are in unnamed module of loader 'app')

AS I see the Java ILP API it contains the method get() witch “Returns a new solver instance.” (Lpsolve?). But why it is not working?

Upvotes: 0

Views: 17

Answers (0)

Related Questions