diff --git a/src/main/java/mvd/jester/App.java b/src/main/java/mvd/jester/App.java index 7bb1714..73727d5 100644 --- a/src/main/java/mvd/jester/App.java +++ b/src/main/java/mvd/jester/App.java @@ -23,34 +23,33 @@ import mvd.jester.tests.TypeFunction.UnkownStructure; */ public class App { public static void main(String[] args) { - // { - // SystemManager manager = new SystemManager(8); - // DagTaskBuilder builder = new DagTaskBuilder(); - // TestEnvironment te = new TestEnvironment(); + { + SystemManager manager = new SystemManager<>(DagTaskBuilder.class); + TestEnvironment te = new TestEnvironment(); - // // SchmidMottok sm = new SchmidMottok(new KnownStructure(), manager); - // // JiangYi jy = new JiangYi(manager); + // SchmidMottok sm = new SchmidMottok(new KnownStructure(), manager); + // JiangYi jy = new JiangYi(manager); - // // Set set = builder.generateRenyiTaskSet(7.0); - // // final SortedTaskSet rmTasks = new SortedTaskSet<>(sm.getPriorityManager()); - // // rmTasks.addAll(set); + // Set set = builder.generateRenyiTaskSet(7.0); + // final SortedTaskSet rmTasks = new SortedTaskSet<>(sm.getPriorityManager()); + // rmTasks.addAll(set); - // // final SortedTaskSet edfTasks = new SortedTaskSet<>(jy.getPriorityManager()); - // // edfTasks.addAll(set); + // final SortedTaskSet edfTasks = new SortedTaskSet<>(jy.getPriorityManager()); + // edfTasks.addAll(set); - // // jy.runSchedulabilityCheck(edfTasks); - // // sm.runSchedulabilityCheck(rmTasks); + // jy.runSchedulabilityCheck(edfTasks); + // sm.runSchedulabilityCheck(rmTasks); - // List> tests = te.registerTests(Arrays.asList( - // new SchmidMottok(new KnownStructureWithMaxThreads(manager), manager), - // new SchmidMottok(new KnownStructure(), manager), - // // new MelaniButtazzo(manager), - // // new FonsecaNelis(manager), - // new JiangYi(manager))); + List> tests = te.registerTests(Arrays.asList( + new SchmidMottok(new KnownStructureWithMaxThreads(manager), manager), + new SchmidMottok(new KnownStructure(), manager), + // new MelaniButtazzo(manager), + // new FonsecaNelis(manager), + new JiangYi(manager))); - // te.varyRenyiUtilization(builder, tests, 8, 500); - // } + te.varyRenyiUtilization(manager, tests, 500); + } // { // SystemManager manager = new SystemManager(8); // DagTaskBuilder builder = new DagTaskBuilder(); diff --git a/src/main/java/mvd/jester/TestEnvironment.java b/src/main/java/mvd/jester/TestEnvironment.java index 28a60bb..ad7137a 100644 --- a/src/main/java/mvd/jester/TestEnvironment.java +++ b/src/main/java/mvd/jester/TestEnvironment.java @@ -78,15 +78,15 @@ public class TestEnvironment { // resultLogger.logTests(abstractTestInstances); } - public void measureExecutionTimes(final DagTaskBuilder builder, - final List> abstractTestInstances, SystemManager manager, + public void measureExecutionTimes(final SystemManager manager, + final List> abstractTestInstances, final long numberOfMeasurements) { Map, List> results = new LinkedHashMap<>(); abstractTestInstances.forEach(t -> results.put(t, new ArrayList<>())); for (int i = 0; i < numberOfMeasurements; ++i) { double utilization = ThreadLocalRandom.current().nextDouble(1, manager.getNumberOfProcessors()); - Set taskSet = builder.generateTaskSet(utilization); + Set taskSet = manager.getBuilder().generateTaskSet(utilization); for (AbstractTest testInstance : abstractTestInstances) { final PriorityManager priorityManager = testInstance.getPriorityManager(); @@ -108,8 +108,8 @@ public class TestEnvironment { } - public void varyNumberOfProcessors(final DagTaskBuilder builder, - final List> abstractTestInstances, SystemManager manager, + public void varyNumberOfProcessors(final SystemManager manager, + final List> abstractTestInstances, final long numberOfTaskSetsPerStep) { long checkedTasksets = 0; final long numberOfTaskSets = 8 * numberOfTaskSetsPerStep; @@ -123,7 +123,7 @@ public class TestEnvironment { manager.setNumberOfProcessors(numberOfProcessors); resultMap.replaceAll((k, v) -> (long) 0); for (int i = 0; i < numberOfTaskSetsPerStep; ++i) { - final Set taskSet = builder.generateUUnifastTaskSet( + final Set taskSet = manager.getBuilder().generateUUnifastTaskSet( (long) (1.5 * numberOfProcessors), (double) numberOfProcessors * 0.5); System.out.print(checkedTasksets + "/" + numberOfTaskSets + " tasksets tested!\r"); @@ -150,10 +150,11 @@ public class TestEnvironment { } - public void varyNumberOfTasks(final DagTaskBuilder builder, - final List> abstractTestInstances, final long numberOfProcessors, + public void varyNumberOfTasks(final SystemManager manager, + final List> abstractTestInstances, final long numberOfTaskSetsPerStep) { long checkedTasksets = 0; + final long numberOfProcessors = manager.getNumberOfProcessors(); final long numberOfTaskSets = 9 * numberOfTaskSetsPerStep; final ResultLogger resultLogger = new ResultLogger("numberOfTasks_" + numberOfProcessors); @@ -164,8 +165,8 @@ public class TestEnvironment { for (long numberOfTasks = 4; numberOfTasks <= 20; numberOfTasks += 2) { resultMap.replaceAll((k, v) -> (long) 0); for (int i = 0; i < numberOfTaskSetsPerStep; ++i) { - final Set taskSet = builder.generateUUnifastTaskSet(numberOfTasks, - (double) numberOfProcessors * 0.5); + final Set taskSet = manager.getBuilder() + .generateUUnifastTaskSet(numberOfTasks, (double) numberOfProcessors * 0.5); System.out.print(checkedTasksets + "/" + numberOfTaskSets + " tasksets tested!\r"); for (final AbstractTest testInstance : abstractTestInstances) { @@ -190,10 +191,10 @@ public class TestEnvironment { resultLogger.finalize(); } - public void varyUtilization(final DagTaskBuilder builder, - final List> abstractTestInstances, final long numberOfProcessors, + public void varyUtilization(final SystemManager manager, + final List> abstractTestInstances, final long numberOfTaskSetsPerUtil) { - + final long numberOfProcessors = manager.getNumberOfProcessors(); long checkedTasksets = 0; final long numberOfTaskSets = ((numberOfProcessors * 4) - 3) * numberOfTaskSetsPerUtil; @@ -205,7 +206,7 @@ public class TestEnvironment { for (double util = 1; util <= numberOfProcessors; util += 0.25) { resultMap.replaceAll((k, v) -> (long) 0); for (int i = 0; i < numberOfTaskSetsPerUtil; ++i) { - final Set taskSet = builder.generateTaskSet(util); + final Set taskSet = manager.getBuilder().generateTaskSet(util); System.out.print(checkedTasksets + "/" + numberOfTaskSets + " tasksets tested!\r"); for (final AbstractTest testInstance : abstractTestInstances) { @@ -230,10 +231,10 @@ public class TestEnvironment { resultLogger.finalize(); } - public void varyRenyiUtilization(final DagTaskBuilder builder, - final List> abstractTestInstances, final long numberOfProcessors, + public void varyRenyiUtilization(final SystemManager manager, + final List> abstractTestInstances, final long numberOfTaskSetsPerUtil) { - + final long numberOfProcessors = manager.getNumberOfProcessors(); long checkedTasksets = 0; final long numberOfTaskSets = ((numberOfProcessors * 4) - 3) * numberOfTaskSetsPerUtil; @@ -242,10 +243,10 @@ public class TestEnvironment { abstractTestInstances.forEach(t -> resultMap.put(t, (long) 0)); resultLogger.logHeader(resultMap, "Utilization"); - for (double util = 5; util <= numberOfProcessors; util += 0.25) { + for (double util = 1; util <= numberOfProcessors; util += 0.25) { resultMap.replaceAll((k, v) -> (long) 0); for (int i = 0; i < numberOfTaskSetsPerUtil; ++i) { - final Set taskSet = builder.generateRenyiTaskSet(util); + final Set taskSet = manager.getBuilder().generateRenyiTaskSet(util); System.out.print(checkedTasksets + "/" + numberOfTaskSets + " tasksets tested!\r"); for (final AbstractTest testInstance : abstractTestInstances) { diff --git a/src/main/java/mvd/jester/model/SystemManager.java b/src/main/java/mvd/jester/model/SystemManager.java index b02d357..87c96f9 100644 --- a/src/main/java/mvd/jester/model/SystemManager.java +++ b/src/main/java/mvd/jester/model/SystemManager.java @@ -14,32 +14,50 @@ import org.apache.commons.math3.distribution.GammaDistribution; import org.jgrapht.experimental.dag.DirectedAcyclicGraph; import org.jgrapht.graph.DefaultEdge; import mvd.jester.utils.DagUtils; +import mvd.jester.model.SystemManager.Builder; /** * TaskSet */ -public class SystemManager { - private long numberOfProcessors; +public class SystemManager implements SystemManagerInterface { - public SystemManager(final long numberOfProcessors) { - this.numberOfProcessors = numberOfProcessors; + private final T builder; + + public SystemManager(Class builder) { + try { + this.builder = builder.getDeclaredConstructor().newInstance(); + } catch (Exception e) { + throw new RuntimeException("Builder could not be instantiated!"); + } } /** * @return the numberOfProcessors */ public long getNumberOfProcessors() { - return numberOfProcessors; + return builder.getNumberOfProcessors(); } /** * @param numberOfProcessors the numberOfProcessors to set */ public void setNumberOfProcessors(long numberOfProcessors) { - this.numberOfProcessors = numberOfProcessors; + builder.setNumberOfProcessors(numberOfProcessors); + } + + public T getBuilder() { + return builder; + } + + public static interface Builder { + + public long getNumberOfProcessors(); + + public Builder setNumberOfProcessors(long numberOfProcessors); + } - public static class SynchronousTaskBuilder { + public static class SynchronousTaskBuilder implements Builder { private long numberOfProcessors = 4; private long minPeriod = 100; private long maxSequentialPeriod = 1000; @@ -53,7 +71,6 @@ public class SystemManager { private final long parallelTaskRatio = 0; public SynchronousTaskBuilder() { - } private long randomSequentialTaskPeriod() { @@ -110,21 +127,11 @@ public class SystemManager { return taskSet; } - // public SystemSetup build() { - // this.ratio = randomTaskRatio(this.parallelTaskRatio); - // final Set taskSet = generateTaskSet(); - // return new SystemSetup<>(taskSet, numberOfProcessors); - // } - - // public Set rebuild(final SystemSetup systemSetup) { - // this.ratio = randomTaskRatio(this.parallelTaskRatio); - // return generateTaskSet(); - // } - public boolean addTask(final Set taskSet) { return taskSet.add(generateTask()); } + @Override public SynchronousTaskBuilder setNumberOfProcessors(final long numberOfProcessors) { this.numberOfProcessors = numberOfProcessors; @@ -157,9 +164,14 @@ public class SystemManager { this.maxNumberOfJobs = maxNumberOfJobs; return this; } + + @Override + public long getNumberOfProcessors() { + return numberOfProcessors; + } } - public static class DagTaskBuilder { + public static class DagTaskBuilder implements Builder { private long numberOfProcessors = 8; private long minimumWcet = 1; private long maximumWcet = 100; @@ -167,7 +179,7 @@ public class SystemManager { private long maxNumberOfThreads = numberOfProcessors; private long depth = 2; private long p_par = 80; - private long p_add = 10; // TODO: Change back to 0.2 + private long p_add = 20; // TODO: Change back to 0.2 public DagTaskBuilder() { } @@ -268,12 +280,13 @@ public class SystemManager { final long criticalPath = DagUtils.calculateCriticalPath(jobDag); final long period = randomRenyiPeriod(workload, criticalPath, totalUtilization); - // final long numberOfThreads = LongMath.divide(workload - criticalPath, - // period - criticalPath, RoundingMode.CEILING) + 1; + final long minNumberOfThreads = LongMath.divide(workload - criticalPath, + period - criticalPath, RoundingMode.FLOOR); - final long numberOfThreads = randomNumberOfThreads(numberOfProcessors / 2); + // TODO: change back to following: + // final long numberOfThreads = randomNumberOfThreads(minNumberOfThreads); - return new DagTask(jobDag, period, numberOfThreads); + return new DagTask(jobDag, period, minNumberOfThreads); } private long randomRenyiPeriod(final long workload, final long criticalPath, @@ -448,6 +461,7 @@ public class SystemManager { /** * @param numberOfProcessors the numberOfProcessors to set */ + @Override public DagTaskBuilder setNumberOfProcessors(final long numberOfProcessors) { this.numberOfProcessors = numberOfProcessors; return this; @@ -456,6 +470,7 @@ public class SystemManager { /** * @return the numberOfProcessors */ + @Override public long getNumberOfProcessors() { return numberOfProcessors; } diff --git a/src/main/java/mvd/jester/model/SystemManagerInterface.java b/src/main/java/mvd/jester/model/SystemManagerInterface.java new file mode 100644 index 0000000..efc0d30 --- /dev/null +++ b/src/main/java/mvd/jester/model/SystemManagerInterface.java @@ -0,0 +1,7 @@ +package mvd.jester.model; + +public interface SystemManagerInterface { + + public long getNumberOfProcessors(); + +} diff --git a/src/main/java/mvd/jester/tests/AbstractTest.java b/src/main/java/mvd/jester/tests/AbstractTest.java index 347d9f0..4ecd1a0 100644 --- a/src/main/java/mvd/jester/tests/AbstractTest.java +++ b/src/main/java/mvd/jester/tests/AbstractTest.java @@ -1,7 +1,7 @@ package mvd.jester.tests; import mvd.jester.TypeInterface; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; /** @@ -9,9 +9,9 @@ import mvd.jester.model.Task; */ public abstract class AbstractTest implements TestInterface, TypeInterface { - protected final SystemManager manager; + protected final SystemManagerInterface manager; - public AbstractTest(final SystemManager manager) { + public AbstractTest(final SystemManagerInterface manager) { this.manager = manager; } diff --git a/src/main/java/mvd/jester/tests/ChwaLee.java b/src/main/java/mvd/jester/tests/ChwaLee.java index e363bcf..ffb1e71 100644 --- a/src/main/java/mvd/jester/tests/ChwaLee.java +++ b/src/main/java/mvd/jester/tests/ChwaLee.java @@ -13,7 +13,7 @@ import mvd.jester.info.TerminationInfo; import mvd.jester.model.Segment; import mvd.jester.model.SortedTaskSet; import mvd.jester.model.SynchronousTask; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.priority.EarliestDeadlineFirst; import mvd.jester.priority.PriorityManager; @@ -25,7 +25,7 @@ public class ChwaLee extends AbstractTest { private final Map responseTimes; private final PriorityManager priorityManager; - public ChwaLee(final SystemManager manager) { + public ChwaLee(final SystemManagerInterface manager) { super(manager); this.responseTimes = new HashMap<>(); this.priorityManager = new EarliestDeadlineFirst(); diff --git a/src/main/java/mvd/jester/tests/FonsecaNelis.java b/src/main/java/mvd/jester/tests/FonsecaNelis.java index f575783..240374f 100644 --- a/src/main/java/mvd/jester/tests/FonsecaNelis.java +++ b/src/main/java/mvd/jester/tests/FonsecaNelis.java @@ -21,7 +21,7 @@ import mvd.jester.model.DagTask; import mvd.jester.model.Job; import mvd.jester.model.Segment; import mvd.jester.model.SortedTaskSet; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; import mvd.jester.model.TreeJob; import mvd.jester.utils.DagUtils; @@ -37,7 +37,7 @@ public class FonsecaNelis extends AbstractTest { private final PriorityManager priorityManager; private final Map> carryOutSegments; - public FonsecaNelis(final SystemManager manager) { + public FonsecaNelis(final SystemManagerInterface manager) { super(manager); this.responseTimes = new HashMap<>(); this.priorityManager = new RateMonotonic(); diff --git a/src/main/java/mvd/jester/tests/JiangYi.java b/src/main/java/mvd/jester/tests/JiangYi.java index bcea409..0566ed6 100644 --- a/src/main/java/mvd/jester/tests/JiangYi.java +++ b/src/main/java/mvd/jester/tests/JiangYi.java @@ -12,7 +12,7 @@ import mvd.jester.info.SchedulingInfo.Feasiblity; import mvd.jester.model.ContainerTask; import mvd.jester.model.DagTask; import mvd.jester.model.SortedTaskSet; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; import mvd.jester.priority.EarliestDeadlineFirst; import mvd.jester.priority.PriorityManager; @@ -21,7 +21,7 @@ public class JiangYi extends AbstractTest { private final EarliestDeadlineFirst priorityManager; - public JiangYi(SystemManager manager) { + public JiangYi(SystemManagerInterface manager) { super(manager); this.priorityManager = new EarliestDeadlineFirst(); } diff --git a/src/main/java/mvd/jester/tests/MaiaBertogna.java b/src/main/java/mvd/jester/tests/MaiaBertogna.java index 3255c37..960b580 100644 --- a/src/main/java/mvd/jester/tests/MaiaBertogna.java +++ b/src/main/java/mvd/jester/tests/MaiaBertogna.java @@ -10,7 +10,7 @@ import mvd.jester.info.TerminationInfo; import mvd.jester.model.Segment; import mvd.jester.model.SortedTaskSet; import mvd.jester.model.SynchronousTask; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.priority.PriorityManager; import mvd.jester.priority.RateMonotonic; @@ -22,7 +22,7 @@ public class MaiaBertogna extends AbstractTest { private final Map responseTimes; private final PriorityManager priorityManager; - public MaiaBertogna(final SystemManager manager) { + public MaiaBertogna(final SystemManagerInterface manager) { super(manager); this.responseTimes = new HashMap<>(); this.priorityManager = new RateMonotonic(); diff --git a/src/main/java/mvd/jester/tests/MelaniButtazzo.java b/src/main/java/mvd/jester/tests/MelaniButtazzo.java index a91e7c7..3d8cb10 100644 --- a/src/main/java/mvd/jester/tests/MelaniButtazzo.java +++ b/src/main/java/mvd/jester/tests/MelaniButtazzo.java @@ -9,7 +9,7 @@ import mvd.jester.info.SchedulingInfo; import mvd.jester.info.TerminationInfo; import mvd.jester.model.DagTask; import mvd.jester.model.SortedTaskSet; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; import mvd.jester.priority.PriorityManager; import mvd.jester.priority.RateMonotonic; @@ -19,7 +19,7 @@ public class MelaniButtazzo extends AbstractTest { private final Map responseTimes; private final PriorityManager priorityManager; - public MelaniButtazzo(final SystemManager manager) { + public MelaniButtazzo(final SystemManagerInterface manager) { super(manager); this.responseTimes = new HashMap<>(); this.priorityManager = new RateMonotonic(); diff --git a/src/main/java/mvd/jester/tests/SchmidMottok.java b/src/main/java/mvd/jester/tests/SchmidMottok.java index 0fb1383..2195ef7 100644 --- a/src/main/java/mvd/jester/tests/SchmidMottok.java +++ b/src/main/java/mvd/jester/tests/SchmidMottok.java @@ -7,7 +7,7 @@ import mvd.jester.info.SchedulingInfo; import mvd.jester.info.TerminationInfo; import mvd.jester.model.DagTask; import mvd.jester.model.SortedTaskSet; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; import mvd.jester.priority.PriorityManager; import mvd.jester.priority.RateMonotonic; @@ -21,7 +21,7 @@ public class SchmidMottok extends AbstractTest { private final PriorityManager priorityManager; private final TypeFunction structure; - public SchmidMottok(TypeFunction structure, final SystemManager manager) { + public SchmidMottok(TypeFunction structure, final SystemManagerInterface manager) { super(manager); this.responseTimes = new HashMap<>(); this.priorityManager = new RateMonotonic(); @@ -54,22 +54,21 @@ public class SchmidMottok extends AbstractTest { long responseTime = minimumWcet; long previousResponseTime = 0; + long occupiedProcessors = 0; // manager.getNumberOfProcessors() + 1; + for (final DagTask t : tasks) { + if (t.getPeriod() < task.getPeriod()) { + final long numberOfProcessors = structure.getNumberOfThreads(t); + occupiedProcessors += numberOfProcessors; + } + } + do { previousResponseTime = responseTime; double taskInterference = 0; - - long occupiedProcessors = manager.getNumberOfProcessors() + 1; - // for (final DagTask t : tasks) { - // if (t.getPeriod() < task.getPeriod()) { - // final long numberOfProcessors = structure.getNumerOfThreads(t); - // occupiedProcessors += numberOfProcessors; - // } - // } - for (final DagTask t : tasks) { if (t.getPeriod() < task.getPeriod()) { - final long numberOfProcessors = structure.getNumerOfThreads(t); - for (int p = 0; p < numberOfProcessors; ++p) { + final long numberOfThreads = structure.getNumberOfThreads(t); + for (int p = 0; p < numberOfThreads; ++p) { if (occupiedProcessors > manager.getNumberOfProcessors()) { taskInterference += Math.min( diff --git a/src/main/java/mvd/jester/tests/TypeFunction.java b/src/main/java/mvd/jester/tests/TypeFunction.java index a972f02..4772101 100644 --- a/src/main/java/mvd/jester/tests/TypeFunction.java +++ b/src/main/java/mvd/jester/tests/TypeFunction.java @@ -6,7 +6,7 @@ import com.google.common.math.LongMath; import mvd.jester.info.TerminationInfo; import mvd.jester.model.DagTask; import mvd.jester.model.Segment; -import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; public interface TypeFunction { @@ -17,15 +17,15 @@ public interface TypeFunction { public double getSelfInterference(final DagTask task); - public long getNumerOfThreads(final DagTask task); + public long getNumberOfThreads(final DagTask task); public String getType(); public class KnownStructureWithMaxThreads implements TypeFunction { - private final SystemManager manager; + private final SystemManagerInterface manager; - public KnownStructureWithMaxThreads(final SystemManager manager) { + public KnownStructureWithMaxThreads(final SystemManagerInterface manager) { this.manager = manager; } @@ -75,7 +75,7 @@ public interface TypeFunction { } @Override - public long getNumerOfThreads(final DagTask task) { + public long getNumberOfThreads(final DagTask task) { return manager.getNumberOfProcessors(); } } @@ -127,7 +127,7 @@ public interface TypeFunction { } @Override - public long getNumerOfThreads(final DagTask task) { + public long getNumberOfThreads(final DagTask task) { return task.getNumberOfThreads(); } } @@ -180,7 +180,7 @@ public interface TypeFunction { } @Override - public long getNumerOfThreads(final DagTask task) { + public long getNumberOfThreads(final DagTask task) { return task.getNumberOfThreads(); } } diff --git a/src/test/java/mvd/jester/priority/TestEarliestDeadlineFirst.java b/src/test/java/mvd/jester/priority/TestEarliestDeadlineFirst.java index 517f580..bbd40a6 100644 --- a/src/test/java/mvd/jester/priority/TestEarliestDeadlineFirst.java +++ b/src/test/java/mvd/jester/priority/TestEarliestDeadlineFirst.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import mvd.jester.model.SynchronousTask; import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManager.SynchronousTaskBuilder; import mvd.jester.simulator.DynamicForkJoin; import mvd.jester.simulator.ParallelSynchronous; import mvd.jester.simulator.internals.parallelsynchronous.TaskContext; @@ -49,7 +50,8 @@ public class TestEarliestDeadlineFirst { @DisplayName("Check Getters, Tests and Simulators.") void testGettersTestsAndSimulators() { EarliestDeadlineFirst edf = new EarliestDeadlineFirst(); - SystemManager manager = new SystemManager(4); + SystemManager manager = + new SystemManager<>(SynchronousTaskBuilder.class); assertTrue(edf.hasTest(ChwaLee.class)); assertFalse(edf.hasTest(MaiaBertogna.class)); assertFalse(edf.hasTest(SchmidMottok.class)); diff --git a/src/test/java/mvd/jester/priority/TestRateMonotonic.java b/src/test/java/mvd/jester/priority/TestRateMonotonic.java index 43970cc..0f2b688 100644 --- a/src/test/java/mvd/jester/priority/TestRateMonotonic.java +++ b/src/test/java/mvd/jester/priority/TestRateMonotonic.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import mvd.jester.model.SynchronousTask; import mvd.jester.model.SystemManager; +import mvd.jester.model.SystemManager.SynchronousTaskBuilder; import mvd.jester.simulator.DynamicForkJoin; import mvd.jester.simulator.ParallelSynchronous; import mvd.jester.simulator.internals.parallelsynchronous.TaskContext; @@ -48,7 +49,8 @@ public class TestRateMonotonic { @DisplayName("Check Tests and Simulators.") void testTestsAndSimulators() { RateMonotonic rm = new RateMonotonic(); - SystemManager manager = new SystemManager(8); + SystemManager manager = + new SystemManager<>(SynchronousTaskBuilder.class); assertFalse(rm.hasTest(ChwaLee.class)); assertTrue(rm.hasTest(MaiaBertogna.class)); assertTrue(rm.hasTest(SchmidMottok.class));