Skip to content
Snippets Groups Projects
Commit 72617be2 authored by Johannes Mey's avatar Johannes Mey
Browse files

improve tests

parent 27515144
Branches
Tags
No related merge requests found
...@@ -6,6 +6,6 @@ public class ILPExternalHandwrittenTest extends HandwrittenTestSuite { ...@@ -6,6 +6,6 @@ public class ILPExternalHandwrittenTest extends HandwrittenTestSuite {
@Override @Override
protected Solver getSolver() { protected Solver getSolver() {
// set to false for debugging // set to false for debugging
return new ILPExternalSolver().setDeleteFilesOnExit(true); return new ILPExternalSolver().setDeleteFilesOnExit(false);
} }
} }
...@@ -6,6 +6,6 @@ public class RandomHandwrittenTest extends HandwrittenTestSuite { ...@@ -6,6 +6,6 @@ public class RandomHandwrittenTest extends HandwrittenTestSuite {
@Override @Override
protected Solver getSolver() { protected Solver getSolver() {
return new RandomSolver(5000, 0); return new RandomSolver(3000, 0);
} }
} }
...@@ -42,7 +42,7 @@ public class RandomSolverTest { ...@@ -42,7 +42,7 @@ public class RandomSolverTest {
ScenarioGenerator generator = new ScenarioGenerator(new ScenarioDescription(tlc, iac, isd, cac, csd, dep, imp, res, req, cpu, seed)); ScenarioGenerator generator = new ScenarioGenerator(new ScenarioDescription(tlc, iac, isd, cac, csd, dep, imp, res, req, cpu, seed));
Root model = generator.generate(); Root model = generator.generate();
RandomSolver solver = new RandomSolver(5000, 1337); RandomSolver solver = new RandomSolver(20000, 0);
Solution solution = solver.solve(model); Solution solution = solver.solve(model);
......
package de.tudresden.inf.st.mquat.solving; package de.tudresden.inf.st.mquat.solving;
import beaver.Parser; import beaver.Parser;
import de.tudresden.inf.st.mquat.generator.ScenarioDescription;
import de.tudresden.inf.st.mquat.generator.ScenarioGenerator;
import de.tudresden.inf.st.mquat.jastadd.model.*; import de.tudresden.inf.st.mquat.jastadd.model.*;
import de.tudresden.inf.st.mquat.utils.ParserUtils; import de.tudresden.inf.st.mquat.utils.ParserUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -172,4 +174,20 @@ public abstract class HandwrittenTestSuite { ...@@ -172,4 +174,20 @@ public abstract class HandwrittenTestSuite {
assertTrue(modelAndSolution.getSecondElement().isValid()); assertTrue(modelAndSolution.getSecondElement().isValid());
} }
@Test
public void test_paper() throws SolvingException {
ScenarioDescription scenarioDescription = new ScenarioDescription(1, 2, 0, 0, 0, 2, 2, 1.1, 1, 1, 9);
ScenarioGenerator generator = new ScenarioGenerator(scenarioDescription);
Root model = generator.generate();
Solution solution = solver.solve(model);
if (logger.isDebugEnabled()) {
logger.info("Model:\n{}",model.print(new MquatWriteSettings(" ")));
logger.info("Solution:\n{}",solution.print(new MquatWriteSettings(" ")));
}
assertValidSolution(new Tuple<>(model, solution));
assertTrue(solution.isValid());
}
} }
...@@ -43,7 +43,7 @@ meta size ...@@ -43,7 +43,7 @@ meta size
property energy [J] property energy [J]
property quality [%] property quality [%]
component component_0 { component component_0 {
contract implementation_0i0 { contract impl_0i0 {
requires component the_component_0i0_0 of type component_0i0_0 requires component the_component_0i0_0 of type component_0i0_0
requires component the_component_0i0_1 of type component_0i0_1 requires component the_component_0i0_1 of type component_0i0_1
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
...@@ -57,7 +57,7 @@ component component_0 { ...@@ -57,7 +57,7 @@ component component_0 {
providing quality = 6.0 providing quality = 6.0
providing energy = ((0.87*(size^2.0))+(0.98*cpu_0.frequency)) providing energy = ((0.87*(size^2.0))+(0.98*cpu_0.frequency))
} }
contract implementation_0i1 { contract impl_0i1 {
requires component the_component_0i1_0 of type component_0i1_0 requires component the_component_0i1_0 of type component_0i1_0
requires component the_component_0i1_1 of type component_0i1_1 requires component the_component_0i1_1 of type component_0i1_1
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
...@@ -76,7 +76,7 @@ component component_0 { ...@@ -76,7 +76,7 @@ component component_0 {
} }
component component_0i0_0 { component component_0i0_0 {
contract implementation_0i0_0i0 { contract impl_0i0_0i0 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 1715.0 requiring cpu_0.frequency >= 1715.0
...@@ -86,7 +86,7 @@ component component_0i0_0 { ...@@ -86,7 +86,7 @@ component component_0i0_0 {
providing quality = 9.0 providing quality = 9.0
providing energy = ((0.31*(size^2.0))+(0.12*cpu_0.frequency)) providing energy = ((0.31*(size^2.0))+(0.12*cpu_0.frequency))
} }
contract implementation_0i0_0i1 { contract impl_0i0_0i1 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 2290.0 requiring cpu_0.frequency >= 2290.0
...@@ -101,7 +101,7 @@ component component_0i0_0 { ...@@ -101,7 +101,7 @@ component component_0i0_0 {
} }
component component_0i0_1 { component component_0i0_1 {
contract implementation_0i0_1i0 { contract impl_0i0_1i0 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 1718.0 requiring cpu_0.frequency >= 1718.0
...@@ -111,7 +111,7 @@ component component_0i0_1 { ...@@ -111,7 +111,7 @@ component component_0i0_1 {
providing quality = 68.0 providing quality = 68.0
providing energy = ((0.15*(size^2.0))+(0.02*cpu_0.frequency)) providing energy = ((0.15*(size^2.0))+(0.02*cpu_0.frequency))
} }
contract implementation_0i0_1i1 { contract impl_0i0_1i1 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 734.0 requiring cpu_0.frequency >= 734.0
...@@ -126,7 +126,7 @@ component component_0i0_1 { ...@@ -126,7 +126,7 @@ component component_0i0_1 {
} }
component component_0i1_0 { component component_0i1_0 {
contract implementation_0i1_0i0 { contract impl_0i1_0i0 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 2877.0 requiring cpu_0.frequency >= 2877.0
...@@ -136,7 +136,7 @@ component component_0i1_0 { ...@@ -136,7 +136,7 @@ component component_0i1_0 {
providing quality = 15.0 providing quality = 15.0
providing energy = ((0.53*(size^2.0))+(0.9*cpu_0.frequency)) providing energy = ((0.53*(size^2.0))+(0.9*cpu_0.frequency))
} }
contract implementation_0i1_0i1 { contract impl_0i1_0i1 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 1601.0 requiring cpu_0.frequency >= 1601.0
...@@ -151,7 +151,7 @@ component component_0i1_0 { ...@@ -151,7 +151,7 @@ component component_0i1_0 {
} }
component component_0i1_1 { component component_0i1_1 {
contract implementation_0i1_1i0 { contract impl_0i1_1i0 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 975.0 requiring cpu_0.frequency >= 975.0
...@@ -161,7 +161,7 @@ component component_0i1_1 { ...@@ -161,7 +161,7 @@ component component_0i1_1 {
providing quality = 75.0 providing quality = 75.0
providing energy = ((0.67*(size^2.0))+(0.69*cpu_0.frequency)) providing energy = ((0.67*(size^2.0))+(0.69*cpu_0.frequency))
} }
contract implementation_0i1_1i1 { contract impl_0i1_1i1 {
requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK requires resource compute_resource_0 of type ComputeNode with { cpu_0 of type CPU ram_1 of type RAM disk_1 of type DISK
network_1 of type NETWORK } network_1 of type NETWORK }
requiring cpu_0.frequency >= 2476.0 requiring cpu_0.frequency >= 2476.0
...@@ -174,7 +174,7 @@ component component_0i1_1 { ...@@ -174,7 +174,7 @@ component component_0i1_1 {
using property quality using property quality
using property energy using property energy
} }
request request0 for component_0 { request rq0 for component_0 {
meta size = 917.0 meta size = 917.0
requiring quality >= 45.0 requiring quality >= 45.0
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment