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());
}
}
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);
}
}
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);
}
}
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);
}
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());
}
Aggregations