Search in sources :

Example 16 with MathProgSysModel

use of org.ojalgo.optimisation.MathProgSysModel in project ojAlgo by optimatika.

the class LpsolveSemiContCase method testSemiContOrg.

@Test
@Disabled("Underscored before JUnit 5")
public void testSemiContOrg() {
    final File tmpFile = new File(PATH + "lpsolve_sc_org.mps");
    final MathProgSysModel tmpMPS = MathProgSysModel.make(tmpFile);
    final ExpressionsBasedModel tmpModel = tmpMPS.getExpressionsBasedModel();
    tmpModel.minimise();
    TestUtils.assertTrue(tmpModel.validate());
    final BigDecimal tmpExpVal = new BigDecimal("6.83333");
    final double tmpActVal = tmpModel.maximise().getValue();
    if (!tmpModel.validate(PRECISION)) {
        TestUtils.fail(SOLUTION_NOT_VALID);
    }
    TestUtils.assertEquals(tmpExpVal.doubleValue(), tmpActVal, PRECISION);
}
Also used : MathProgSysModel(org.ojalgo.optimisation.MathProgSysModel) File(java.io.File) ExpressionsBasedModel(org.ojalgo.optimisation.ExpressionsBasedModel) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

File (java.io.File)16 MathProgSysModel (org.ojalgo.optimisation.MathProgSysModel)16 ExpressionsBasedModel (org.ojalgo.optimisation.ExpressionsBasedModel)15 Test (org.junit.jupiter.api.Test)14 BigDecimal (java.math.BigDecimal)12 Disabled (org.junit.jupiter.api.Disabled)2 Variable (org.ojalgo.optimisation.Variable)2 Expression (org.ojalgo.optimisation.Expression)1 Optimisation (org.ojalgo.optimisation.Optimisation)1 Result (org.ojalgo.optimisation.Optimisation.Result)1 State (org.ojalgo.optimisation.Optimisation.State)1