Search in sources :

Example 1 with Disabled

use of org.junit.jupiter.api.Disabled in project solution-finder by knewjade.

the class CheckmateUsingHoldReuseTest method randomCheckmateWithJustBlockTwice.

@Disabled
@Test
void randomCheckmateWithJustBlockTwice() {
    Randoms randoms = new Randoms();
    for (int count = 0; count < 25; count++) {
        int maxClearLine = randoms.nextInt(3, 8);
        int maxDepth = randoms.nextIntClosed(5, 7);
        List<Piece> pieces = randoms.blocks(maxDepth);
        Field field = randoms.field(maxClearLine, maxDepth);
        Candidate<Action> candidate = new LockedCandidate(minoFactory, minoShifter, minoRotation, maxClearLine);
        Stopwatch stopwatchNoUse = Stopwatch.createStoppedStopwatch();
        Stopwatch stopwatchReuse1 = Stopwatch.createStoppedStopwatch();
        Stopwatch stopwatchReuse2 = Stopwatch.createStoppedStopwatch();
        for (int swap = 0; swap < 250; swap++) {
            int index = randoms.nextInt(3, pieces.size());
            Piece pop = pieces.remove(index);
            pieces.add(pop);
            stopwatchNoUse.start();
            List<Result> result1 = checkmate.search(field, pieces, candidate, maxClearLine, maxDepth);
            stopwatchNoUse.stop();
            stopwatchReuse1.start();
            List<Result> result2 = checkmateReuse.search(field, pieces, candidate, maxClearLine, maxDepth);
            stopwatchReuse1.stop();
            assertThat(result2).hasSameSizeAs(result1).containsAll(result1);
            stopwatchReuse2.start();
            List<Result> result3 = checkmateReuse.search(field, pieces, candidate, maxClearLine, maxDepth);
            stopwatchReuse2.stop();
            assertThat(result3).hasSameSizeAs(result1).containsAll(result1);
        }
        assertThat(stopwatchReuse1.getNanoAverageTime()).isLessThan(stopwatchNoUse.getNanoAverageTime());
        assertThat(stopwatchReuse2.getNanoAverageTime()).isLessThan(stopwatchReuse1.getNanoAverageTime());
    }
}
Also used : Field(core.field.Field) LockedCandidate(core.action.candidate.LockedCandidate) Randoms(lib.Randoms) Action(common.datastore.action.Action) Piece(core.mino.Piece) Stopwatch(lib.Stopwatch) Result(common.datastore.Result) Test(org.junit.jupiter.api.Test) LongTest(module.LongTest) Disabled(org.junit.jupiter.api.Disabled)

Example 2 with Disabled

use of org.junit.jupiter.api.Disabled in project ojAlgo by optimatika.

the class MarketShareCase method testMipButLinearConstrainedToOptimal.

@Test
@Disabled("Underscored before JUnit 5")
public void testMipButLinearConstrainedToOptimal() {
    final ExpressionsBasedModel tmpModel = MarketShareCase.makeModel();
    for (final Variable tmpVariable : tmpModel.getVariables()) {
        final String tmpName = tmpVariable.getName();
        if (tmpName.startsWith("s")) {
            tmpVariable.level(SOLUTION.get(tmpName));
        }
    }
    final Result tmpResult = tmpModel.minimise();
    TestUtils.assertEquals("OBJECTIVE_MIP", OBJECTIVE_MIP.doubleValue(), tmpResult.getValue(), 1E-14 / PrimitiveMath.THREE);
    for (final Variable tmpVariable : tmpModel.getVariables()) {
        TestUtils.assertEquals(tmpVariable.getName(), SOLUTION.get(tmpVariable.getName()).doubleValue(), tmpVariable.getValue().doubleValue(), 1E-14 / PrimitiveMath.THREE);
    }
}
Also used : Variable(org.ojalgo.optimisation.Variable) ExpressionsBasedModel(org.ojalgo.optimisation.ExpressionsBasedModel) Result(org.ojalgo.optimisation.Optimisation.Result) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 3 with Disabled

use of org.junit.jupiter.api.Disabled in project ojAlgo by optimatika.

the class MarketShareCase method testFullMIP.

@Test
@Disabled("Underscored before JUnit 5")
public void testFullMIP() {
    final ExpressionsBasedModel tmpModel = MarketShareCase.makeModel();
    // tmpModel.options.debug_stream = BasicLogger.DEBUG;
    // tmpModel.options.debug_solver = IntegerSolver.class;
    // tmpModel.options.validate = true;
    final Result tmpResult = tmpModel.minimise();
    TestUtils.assertEquals("OBJECTIVE_MIP", OBJECTIVE_MIP.doubleValue(), tmpResult.getValue(), 1E-14 / PrimitiveMath.THREE);
    for (final Variable tmpVariable : tmpModel.getVariables()) {
        TestUtils.assertEquals(tmpVariable.getName(), SOLUTION.get(tmpVariable.getName()).doubleValue(), tmpVariable.getValue().doubleValue(), 1E-14 / PrimitiveMath.THREE);
    }
}
Also used : Variable(org.ojalgo.optimisation.Variable) ExpressionsBasedModel(org.ojalgo.optimisation.ExpressionsBasedModel) Result(org.ojalgo.optimisation.Optimisation.Result) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 4 with Disabled

use of org.junit.jupiter.api.Disabled in project ojAlgo by optimatika.

the class LpsolveSemiContCase method testSemiContNot.

@Test
@Disabled("Underscored before JUnit 5")
public void testSemiContNot() {
    final File tmpFile = new File(PATH + "lpsolve_sc_not.mps");
    final MathProgSysModel tmpMPS = MathProgSysModel.make(tmpFile);
    final ExpressionsBasedModel tmpModel = tmpMPS.getExpressionsBasedModel();
    tmpModel.minimise();
    TestUtils.assertTrue(tmpModel.validate());
    final BigDecimal tmpExpVal = new BigDecimal("3.93333");
    final double tmpActVal = tmpModel.minimise().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)

Example 5 with Disabled

use of org.junit.jupiter.api.Disabled in project indriya by unitsofmeasurement.

the class LocalFormatTest method testPrefixKm.

@Test
@Disabled
public // TODO LocalUnitFormat won't parse Compound Units, EBNF does, also see https://github.com/unitsofmeasurement/uom-se/issues/145
void testPrefixKm() {
    final UnitFormat format = LocalUnitFormat.getInstance();
    Unit<?> u = format.parse("km");
    assertEquals(KILO(METRE), u);
    assertEquals("km", u.toString());
}
Also used : UnitFormat(javax.measure.format.UnitFormat) LocalUnitFormat(tech.units.indriya.format.LocalUnitFormat) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)264 Test (org.junit.jupiter.api.Test)250 File (java.io.File)17 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 ArrayList (java.util.ArrayList)12 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 HashMap (java.util.HashMap)10 NAR (nars.NAR)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 List (java.util.List)8 BaseDataTest (org.apache.ibatis.BaseDataTest)8 Path (java.nio.file.Path)7 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7 SqlSession (org.apache.ibatis.session.SqlSession)7 Vector3i (org.joml.Vector3i)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 AnswerSet (at.ac.tuwien.kr.alpha.api.AnswerSet)6 ASPCore2Program (at.ac.tuwien.kr.alpha.api.programs.ASPCore2Program)6 RectDouble2D (jcog.tree.rtree.rect.RectDouble2D)6