From 43947796a02004343a6e909fe3018f8b01009e18 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Fri, 25 Sep 2020 15:13:58 +0200 Subject: [PATCH] Small changes, mostly renaming --- .project | 11 +++++++++++ src/main/java/mvd/jester/App.java | 23 ++++++++++++----------- src/main/java/mvd/jester/TestEnvironment.java | 3 ++- src/main/java/mvd/jester/model/DagTask.java | 4 ++-- src/main/java/mvd/jester/model/Segment.java | 18 +++++++++--------- src/main/java/mvd/jester/model/SynchronousTask.java | 8 ++++---- src/main/java/mvd/jester/model/SystemManager.java | 17 ++++++----------- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java | 2 +- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java | 4 ++-- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java | 2 +- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java | 4 ++-- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java | 2 +- src/main/java/mvd/jester/tests/ChwaLee.java | 20 ++++++++++---------- src/main/java/mvd/jester/tests/FonsecaNelis.java | 12 ++++++------ src/main/java/mvd/jester/tests/MaiaBertogna.java | 10 +++++----- src/main/java/mvd/jester/tests/SchmidMottok.java | 18 +++--------------- src/main/java/mvd/jester/tests/TypeFunction.java | 14 +++++--------- src/test/java/mvd/jester/model/TestSegment.java | 8 ++++---- src/test/java/mvd/jester/model/TestSystemSetup.java | 8 ++++---- src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java | 6 +++--- src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java | 2 +- 21 files changed, 94 insertions(+), 102 deletions(-) diff --git a/.project b/.project index e0c919e..a8be2b2 100644 --- a/.project +++ b/.project @@ -20,4 +20,15 @@ org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + + + 1600851289823 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/src/main/java/mvd/jester/App.java b/src/main/java/mvd/jester/App.java index 73727d5..a7faff3 100644 --- a/src/main/java/mvd/jester/App.java +++ b/src/main/java/mvd/jester/App.java @@ -30,7 +30,7 @@ public class App { // SchmidMottok sm = new SchmidMottok(new KnownStructure(), manager); // JiangYi jy = new JiangYi(manager); - // Set set = builder.generateRenyiTaskSet(7.0); + // Set set = manager.getBuilder().generateRenyiTaskSet(7.0); // final SortedTaskSet rmTasks = new SortedTaskSet<>(sm.getPriorityManager()); // rmTasks.addAll(set); @@ -45,10 +45,10 @@ public class App { new SchmidMottok(new KnownStructureWithMaxThreads(manager), manager), new SchmidMottok(new KnownStructure(), manager), // new MelaniButtazzo(manager), - // new FonsecaNelis(manager), - new JiangYi(manager))); + new FonsecaNelis(manager) + /* new JiangYi(manager) */)); - te.varyRenyiUtilization(manager, tests, 500); + te.varyRenyiUtilization(manager, tests, 100); } // { // SystemManager manager = new SystemManager(8); @@ -65,16 +65,17 @@ public class App { // te.varyUtilization(builder, tests, 8, 500); // } // { - // SystemManager manager = new SystemManager(8); - // DagTaskBuilder builder = new DagTaskBuilder(); + // SystemManager manager = new SystemManager<>(DagTaskBuilder.class); // TestEnvironment te = new TestEnvironment(); - // List> tests = - // te.registerTests(Arrays.asList(new SchmidMottok(new UnkownStructure(), manager), - // new SchmidMottok(new KownStructure(), manager), - // new MelaniButtazzo(manager), new FonsecaNelis(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.varyNumberOfProcessors(builder, tests, manager, 500); + // te.varyNumberOfProcessors(manager, tests, 500); // } // { // SystemManager manager = new SystemManager(8); diff --git a/src/main/java/mvd/jester/TestEnvironment.java b/src/main/java/mvd/jester/TestEnvironment.java index ad7137a..a715e25 100644 --- a/src/main/java/mvd/jester/TestEnvironment.java +++ b/src/main/java/mvd/jester/TestEnvironment.java @@ -238,7 +238,8 @@ public class TestEnvironment { long checkedTasksets = 0; final long numberOfTaskSets = ((numberOfProcessors * 4) - 3) * numberOfTaskSetsPerUtil; - final ResultLogger resultLogger = new ResultLogger("utilization_" + numberOfProcessors); + final ResultLogger resultLogger = + new ResultLogger("renyi_utilization_" + numberOfProcessors); final Map, Long> resultMap = new LinkedHashMap<>(); abstractTestInstances.forEach(t -> resultMap.put(t, (long) 0)); resultLogger.logHeader(resultMap, "Utilization"); diff --git a/src/main/java/mvd/jester/model/DagTask.java b/src/main/java/mvd/jester/model/DagTask.java index dfa30f3..95955f3 100644 --- a/src/main/java/mvd/jester/model/DagTask.java +++ b/src/main/java/mvd/jester/model/DagTask.java @@ -54,8 +54,8 @@ public class DagTask extends Task { public long getMaximumParallelism() { long max = 0; for (final Segment s : workloadDistribution) { - if (max < s.getNumberOfJobs()) { - max = s.getNumberOfJobs(); + if (max < s.getHeight()) { + max = s.getHeight(); } } return max; diff --git a/src/main/java/mvd/jester/model/Segment.java b/src/main/java/mvd/jester/model/Segment.java index 76faded..8ec37cf 100644 --- a/src/main/java/mvd/jester/model/Segment.java +++ b/src/main/java/mvd/jester/model/Segment.java @@ -3,26 +3,26 @@ package mvd.jester.model; public class Segment { - private final long jobWcet; - private final long numberOfJobs; + private final long width; + private final long height; - public Segment(long jobWcet, long numberOfJobs) { - this.jobWcet = jobWcet; - this.numberOfJobs = numberOfJobs; + public Segment(long width, long height) { + this.width = width; + this.height = height; } /** * @return the numberOfJobs */ - public long getNumberOfJobs() { - return numberOfJobs; + public long getHeight() { + return height; } /** * @return the jobWcet */ - public long getJobWcet() { - return jobWcet; + public long getWidth() { + return width; } } diff --git a/src/main/java/mvd/jester/model/SynchronousTask.java b/src/main/java/mvd/jester/model/SynchronousTask.java index 9427337..4aa2410 100644 --- a/src/main/java/mvd/jester/model/SynchronousTask.java +++ b/src/main/java/mvd/jester/model/SynchronousTask.java @@ -64,8 +64,8 @@ public class SynchronousTask extends Task { public long getMaximumParallelism() { long max = 0; for (final Segment s : segments) { - if (max < s.getNumberOfJobs()) { - max = s.getNumberOfJobs(); + if (max < s.getHeight()) { + max = s.getHeight(); } } return max; @@ -80,7 +80,7 @@ public class SynchronousTask extends Task { public static long calculateWorkload(final Set segments) { long workload = 0; for (final Segment s : segments) { - workload += s.getJobWcet() * s.getNumberOfJobs(); + workload += s.getWidth() * s.getHeight(); } return workload; } @@ -89,7 +89,7 @@ public class SynchronousTask extends Task { public static long calculateCriticalPath(final Set segments) { long criticalPath = 0; for (final Segment s : segments) { - criticalPath += s.getJobWcet(); + criticalPath += s.getWidth(); } return criticalPath; diff --git a/src/main/java/mvd/jester/model/SystemManager.java b/src/main/java/mvd/jester/model/SystemManager.java index 87c96f9..ef55ca5 100644 --- a/src/main/java/mvd/jester/model/SystemManager.java +++ b/src/main/java/mvd/jester/model/SystemManager.java @@ -194,8 +194,8 @@ public class SystemManager implements SystemManagerInterface public Set generateRenyiTaskSet(final double totalUtilization) { final LinkedHashSet taskSet = new LinkedHashSet<>(); - double currentUtilization = 0; + while (currentUtilization <= totalUtilization) { final DagTask dagTask = generateRenyiTask(totalUtilization); @@ -207,8 +207,8 @@ public class SystemManager implements SystemManagerInterface final long period = (long) Math.ceil(dagTask.getWorkload() / remainingUtilization); if (period >= dagTask.getCriticalPath()) { - final DagTask modifiedTask = - new DagTask(dagTask.getJobDag(), period, numberOfProcessors); + final DagTask modifiedTask = new DagTask(dagTask.getJobDag(), period, + dagTask.getNumberOfThreads()); taskSet.add(modifiedTask); break; } @@ -280,19 +280,14 @@ public class SystemManager implements SystemManagerInterface final long criticalPath = DagUtils.calculateCriticalPath(jobDag); final long period = randomRenyiPeriod(workload, criticalPath, totalUtilization); - final long minNumberOfThreads = LongMath.divide(workload - criticalPath, - period - criticalPath, RoundingMode.FLOOR); - - // TODO: change back to following: - // final long numberOfThreads = randomNumberOfThreads(minNumberOfThreads); + final long numberOfThreads = randomNumberOfThreads(numberOfProcessors / 2); - return new DagTask(jobDag, period, minNumberOfThreads); + return new DagTask(jobDag, period, numberOfThreads); } private long randomRenyiPeriod(final long workload, final long criticalPath, final double totalUtilization) { - final double firstPart = - (criticalPath + (double) (workload) / (0.4 * totalUtilization)); + final double firstPart = (criticalPath + (double) (workload) / (0.4 * totalUtilization)); final double gamma = new GammaDistribution(2, 1).sample(); final double secondPart = 1 + 0.25 * gamma; diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java index 5b16ced..ef92607 100644 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java +++ b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java @@ -25,7 +25,7 @@ public class JobContext implements JobContextInterface { this.currentTasklet = Optional.empty(); this.taskContext = taskContext; this.segmentContext = segmentContext; - this.wcet = segmentContext.getSegment().getJobWcet(); + this.wcet = segmentContext.getSegment().getWidth(); } public Optional updateExecution(long time) { diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java index fe91071..2fb24f9 100644 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java +++ b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java @@ -19,8 +19,8 @@ public class SegmentContext { jobs = new HashSet<>(); tasklets = new HashSet<>(); - long numberOfJobs = segment.getNumberOfJobs() > numberOfProcessors ? numberOfProcessors - : segment.getNumberOfJobs(); + long numberOfJobs = + segment.getHeight() > numberOfProcessors ? numberOfProcessors : segment.getHeight(); for (int j = 0; j < numberOfJobs; ++j) { jobs.add(new JobContext(taskContext, this)); diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java index da92104..99389aa 100644 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java +++ b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java @@ -24,7 +24,7 @@ public class JobContext implements JobContextInterface { this.currentProcessor = Optional.empty(); this.taskContext = taskContext; this.segmentContext = segmentContext; - this.wcet = segmentContext.getSegment().getJobWcet(); + this.wcet = segmentContext.getSegment().getWidth(); this.executionTime = wcet; } diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java index b03d8f1..ff4abd9 100644 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java +++ b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java @@ -17,7 +17,7 @@ public class SegmentContext { this.segment = segment; jobs = new HashSet<>(); - for (int j = 0; j < segment.getNumberOfJobs(); ++j) { + for (int j = 0; j < segment.getHeight(); ++j) { jobs.add(new JobContext(taskContext, this)); } } @@ -38,6 +38,6 @@ public class SegmentContext { @Override public String toString() { - return "(nJobs=" + segment.getNumberOfJobs() + ", jobWcet=" + segment.getJobWcet() + ")"; + return "(nJobs=" + segment.getHeight() + ", jobWcet=" + segment.getWidth() + ")"; } } diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java index 5d87ac4..8aaaff5 100644 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java +++ b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java @@ -56,7 +56,7 @@ public class TaskContext implements TaskContextInterface { public Optional acceptNotification(long time) { segmentCounter++; - if (segmentCounter >= segments.get(currentSegment).getSegment().getNumberOfJobs()) { + if (segmentCounter >= segments.get(currentSegment).getSegment().getHeight()) { currentSegment++; segmentCounter = 0; if (currentSegment >= segments.size()) { diff --git a/src/main/java/mvd/jester/tests/ChwaLee.java b/src/main/java/mvd/jester/tests/ChwaLee.java index ffb1e71..453cfb8 100644 --- a/src/main/java/mvd/jester/tests/ChwaLee.java +++ b/src/main/java/mvd/jester/tests/ChwaLee.java @@ -84,8 +84,8 @@ public class ChwaLee extends AbstractTest { long selfInterference = 0; for (final Segment s : task.getWorkloadDistribution()) { - if (s.getNumberOfJobs() >= p + 1) { - selfInterference += s.getJobWcet(); + if (s.getHeight() >= p + 1) { + selfInterference += s.getWidth(); } } return selfInterference; @@ -97,8 +97,8 @@ public class ChwaLee extends AbstractTest { long workloadOfBodyJobs = 0; for (final Segment s : t.getWorkloadDistribution()) { - if (s.getNumberOfJobs() >= p) { - workloadOfBodyJobs += s.getJobWcet(); + if (s.getHeight() >= p) { + workloadOfBodyJobs += s.getWidth(); } } @@ -109,11 +109,11 @@ public class ChwaLee extends AbstractTest { final List segmentList = new ArrayList<>(t.getWorkloadDistribution()); Collections.reverse(segmentList); for (final Segment s : segmentList) { - carryInLength += s.getJobWcet(); - if (s.getNumberOfJobs() >= p && remainingLength > carryInLength) { - boundedCarryInWorkload += s.getJobWcet(); - } else if (s.getNumberOfJobs() >= p && remainingLength <= carryInLength) { - boundedCarryInWorkload += s.getJobWcet() - (carryInLength - remainingLength); + carryInLength += s.getWidth(); + if (s.getHeight() >= p && remainingLength > carryInLength) { + boundedCarryInWorkload += s.getWidth(); + } else if (s.getHeight() >= p && remainingLength <= carryInLength) { + boundedCarryInWorkload += s.getWidth() - (carryInLength - remainingLength); } if (carryInLength >= remainingLength) { break; @@ -126,7 +126,7 @@ public class ChwaLee extends AbstractTest { private long getMinimumWcet(final SynchronousTask task) { long minWcet = 0; for (final Segment s : task.getWorkloadDistribution()) { - minWcet += s.getJobWcet(); + minWcet += s.getWidth(); } return minWcet; diff --git a/src/main/java/mvd/jester/tests/FonsecaNelis.java b/src/main/java/mvd/jester/tests/FonsecaNelis.java index 240374f..bd03ef0 100644 --- a/src/main/java/mvd/jester/tests/FonsecaNelis.java +++ b/src/main/java/mvd/jester/tests/FonsecaNelis.java @@ -198,7 +198,7 @@ public class FonsecaNelis extends AbstractTest { Collections.reverse(reverseCarryInList); for (final Segment s : reverseCarryInList) { - carryInPeriod += s.getJobWcet(); + carryInPeriod += s.getWidth(); carryOutPeriod = carryInAndOutPeriod - carryInPeriod; final long carryInWorkload = getCarryInWorkload(task, carryInDistribution, carryInPeriod); @@ -212,7 +212,7 @@ public class FonsecaNelis extends AbstractTest { carryOutPeriod = 0; for (final Segment s : carryOutDistribution) { - carryOutPeriod += s.getJobWcet(); + carryOutPeriod += s.getWidth(); carryInPeriod = carryInAndOutPeriod - carryOutPeriod; final long carryInWorkload = getCarryInWorkload(task, carryInDistribution, carryInPeriod); @@ -235,11 +235,11 @@ public class FonsecaNelis extends AbstractTest { final Segment s = distributionList.get(i); long weightOfPreviousSegments = 0; for (int j = 0; j < i; ++j) { - weightOfPreviousSegments += distributionList.get(j).getJobWcet(); + weightOfPreviousSegments += distributionList.get(j).getWidth(); } final long width = carryOutPeriod - weightOfPreviousSegments; - workload += Math.max(Math.min(width, s.getJobWcet()), 0) * s.getNumberOfJobs(); + workload += Math.max(Math.min(width, s.getWidth()), 0) * s.getHeight(); } final long improvedWorkloadFromTask = @@ -262,11 +262,11 @@ public class FonsecaNelis extends AbstractTest { final Segment s = distributionList.get(b); long weightOfRemainingSegments = 0; for (int p = b + 1; p < carryInDistribution.size(); ++p) { - weightOfRemainingSegments += distributionList.get(p).getJobWcet(); + weightOfRemainingSegments += distributionList.get(p).getWidth(); } final long width = carryInPeriod - period + responseTime - weightOfRemainingSegments; - workload += Math.max(Math.min(width, s.getJobWcet()), 0) * s.getNumberOfJobs(); + workload += Math.max(Math.min(width, s.getWidth()), 0) * s.getHeight(); } final long improvedWorkload = Math.max(carryInPeriod - (period - responseTime), 0) diff --git a/src/main/java/mvd/jester/tests/MaiaBertogna.java b/src/main/java/mvd/jester/tests/MaiaBertogna.java index 960b580..f75d28a 100644 --- a/src/main/java/mvd/jester/tests/MaiaBertogna.java +++ b/src/main/java/mvd/jester/tests/MaiaBertogna.java @@ -91,8 +91,8 @@ public class MaiaBertogna extends AbstractTest { long interference = 0; for (final Segment s : task.getWorkloadDistribution()) { - if (s.getNumberOfJobs() >= parallelism + 1) { - interference += s.getJobWcet(); + if (s.getHeight() >= parallelism + 1) { + interference += s.getWidth(); } } @@ -112,8 +112,8 @@ public class MaiaBertogna extends AbstractTest { long workload = 0; for (final Segment s : task.getWorkloadDistribution()) { - if (s.getNumberOfJobs() >= parallelism) { - workload += s.getJobWcet(); + if (s.getHeight() >= parallelism) { + workload += s.getWidth(); } } @@ -128,7 +128,7 @@ public class MaiaBertogna extends AbstractTest { private long getMinimumWcet(final SynchronousTask task) { long minWcet = 0; for (final Segment s : task.getWorkloadDistribution()) { - minWcet += s.getJobWcet(); + minWcet += s.getWidth(); } return minWcet; diff --git a/src/main/java/mvd/jester/tests/SchmidMottok.java b/src/main/java/mvd/jester/tests/SchmidMottok.java index 2195ef7..2b25894 100644 --- a/src/main/java/mvd/jester/tests/SchmidMottok.java +++ b/src/main/java/mvd/jester/tests/SchmidMottok.java @@ -11,6 +11,7 @@ import mvd.jester.model.SystemManagerInterface; import mvd.jester.model.Task; import mvd.jester.priority.PriorityManager; import mvd.jester.priority.RateMonotonic; +import mvd.jester.tests.TypeFunction.KnownStructureWithMaxThreads; /** * SchmidMottok @@ -54,14 +55,6 @@ 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; @@ -69,13 +62,8 @@ public class SchmidMottok extends AbstractTest { if (t.getPeriod() < task.getPeriod()) { final long numberOfThreads = structure.getNumberOfThreads(t); for (int p = 0; p < numberOfThreads; ++p) { - if (occupiedProcessors > manager.getNumberOfProcessors()) { - taskInterference += - Math.min( - structure.getTaskInterference(t, responseTimes, - responseTime, p + 1), - responseTime - minimumWcet + 1); - } + taskInterference += Math.min(structure.getTaskInterference(t, responseTimes, + responseTime, p + 1), responseTime - minimumWcet + 1); } } } diff --git a/src/main/java/mvd/jester/tests/TypeFunction.java b/src/main/java/mvd/jester/tests/TypeFunction.java index 4772101..8ce6295 100644 --- a/src/main/java/mvd/jester/tests/TypeFunction.java +++ b/src/main/java/mvd/jester/tests/TypeFunction.java @@ -44,10 +44,9 @@ public interface TypeFunction { for (final Segment s : task.getWorkloadDistribution()) { final long numberOfThreads = - s.getNumberOfJobs() > 1 ? manager.getNumberOfProcessors() : 1; + s.getHeight() > 1 ? manager.getNumberOfProcessors() : 1; if (numberOfThreads >= parallelism) { - workload += - (double) (s.getNumberOfJobs() * s.getJobWcet()) / numberOfThreads; + workload += (double) (s.getHeight() * s.getWidth()) / numberOfThreads; } } @@ -98,8 +97,7 @@ public interface TypeFunction { for (final Segment s : task.getWorkloadDistribution()) { final long numberOfThreads = task.getNumberOfThreads(); if (numberOfThreads >= parallelism) { - workload += - (double) (s.getNumberOfJobs() * s.getJobWcet()) / numberOfThreads; + workload += (double) (s.getHeight() * s.getWidth()) / numberOfThreads; } } @@ -148,11 +146,9 @@ public interface TypeFunction { double workload = 0; for (final Segment s : task.getWorkloadDistribution()) { - final long numberOfThreads = - s.getNumberOfJobs() > 1 ? task.getNumberOfThreads() : 1; + final long numberOfThreads = s.getHeight() > 1 ? task.getNumberOfThreads() : 1; if (numberOfThreads >= parallelism) { - workload += - (double) (s.getNumberOfJobs() * s.getJobWcet()) / numberOfThreads; + workload += (double) (s.getHeight() * s.getWidth()) / numberOfThreads; } } diff --git a/src/test/java/mvd/jester/model/TestSegment.java b/src/test/java/mvd/jester/model/TestSegment.java index 161cfdf..5756d56 100644 --- a/src/test/java/mvd/jester/model/TestSegment.java +++ b/src/test/java/mvd/jester/model/TestSegment.java @@ -15,10 +15,10 @@ public class TestSegment { Segment s1 = new Segment(100, 10); Segment s2 = new Segment(9, 10); - assertTrue(s1.getJobWcet() == 100); - assertTrue(s1.getNumberOfJobs() == 10); + assertTrue(s1.getWidth() == 100); + assertTrue(s1.getHeight() == 10); - assertTrue(s2.getJobWcet() == 9); - assertTrue(s2.getNumberOfJobs() == 10); + assertTrue(s2.getWidth() == 9); + assertTrue(s2.getHeight() == 10); } } diff --git a/src/test/java/mvd/jester/model/TestSystemSetup.java b/src/test/java/mvd/jester/model/TestSystemSetup.java index bffc2bb..dcf084b 100644 --- a/src/test/java/mvd/jester/model/TestSystemSetup.java +++ b/src/test/java/mvd/jester/model/TestSystemSetup.java @@ -39,10 +39,10 @@ public class TestSystemSetup { long maxJobWcet = t.getPeriod() / t.getWorkloadDistribution().size(); for (Segment s : t.getWorkloadDistribution()) { - assertTrue(s.getJobWcet() >= 1); - assertTrue(s.getJobWcet() <= maxJobWcet); - assertTrue(s.getNumberOfJobs() >= 1); - assertTrue(s.getNumberOfJobs() <= 10); + assertTrue(s.getWidth() >= 1); + assertTrue(s.getWidth() <= maxJobWcet); + assertTrue(s.getHeight() >= 1); + assertTrue(s.getHeight() <= 10); } assertTrue(t.getWorkloadDistribution().size() >= 1); diff --git a/src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java b/src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java index 8b97dc6..74cbc19 100644 --- a/src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java +++ b/src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java @@ -32,7 +32,7 @@ public class TestJobContext { SegmentContext sc = mock(SegmentContext.class); Segment s = mock(Segment.class); when(sc.getSegment()).thenReturn(s); - when(s.getJobWcet()).thenReturn((long) 20); + when(s.getWidth()).thenReturn((long) 20); when(sc.getNextTasklet()).thenReturn(Optional.of(tlc)) .thenReturn(Optional.ofNullable(null)); @@ -53,7 +53,7 @@ public class TestJobContext { SegmentContext sc = mock(SegmentContext.class); Segment s = mock(Segment.class); when(sc.getSegment()).thenReturn(s); - when(s.getJobWcet()).thenReturn((long) 20); + when(s.getWidth()).thenReturn((long) 20); when(tlc.checkExecutionTime()).thenReturn(true, false); JobContext jc = new JobContext(tc, sc); @@ -75,7 +75,7 @@ public class TestJobContext { when(sc.getSegment()).thenReturn(s); when(sc.getNextTasklet()).thenReturn(Optional.ofNullable(tlc)) .thenReturn(Optional.ofNullable(null)); - when(s.getJobWcet()).thenReturn((long) 20); + when(s.getWidth()).thenReturn((long) 20); when(tlc.checkExecutionTime()).thenReturn(true, false); when(tlc.updateExecution(not(eq(0)))).thenReturn(true); when(tlc.updateExecution(0)).thenReturn(false); diff --git a/src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java b/src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java index e67e1a8..1ff7618 100644 --- a/src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java +++ b/src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java @@ -31,7 +31,7 @@ public class TestJobContext { long jobWcet = ThreadLocalRandom.current().nextLong(20, 50); Segment s = mock(Segment.class); - when(s.getJobWcet()).thenReturn(jobWcet); + when(s.getWidth()).thenReturn(jobWcet); SegmentContext sc = mock(SegmentContext.class); when(sc.getSegment()).thenReturn(s); TaskContext tc = mock(TaskContext.class); -- libgit2 0.26.0