From fe6b5585904fbc9d15a1b79605251f05247a0606 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Thu, 13 Aug 2020 11:39:13 +0200 Subject: [PATCH] Deleted old files and minor changes --- src/main/java/mvd/jester/simulator/AbstractSimulator.java | 129 --------------------------------------------------------------------------------------------------------------------------------- src/main/java/mvd/jester/simulator/DynamicForkJoin.java | 37 ------------------------------------- src/main/java/mvd/jester/simulator/GlobalScheduler.java | 2 -- src/main/java/mvd/jester/simulator/ParallelSynchronous.java | 36 ------------------------------------ src/main/java/mvd/jester/simulator/SimulatorInterface.java | 15 --------------- src/main/java/mvd/jester/simulator/events/ISubtaskEvent.java | 1 - src/main/java/mvd/jester/simulator/internals/SortedTaskContextSet.java | 17 ----------------- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java | 129 --------------------------------------------------------------------------------------------------------------------------------- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java | 79 ------------------------------------------------------------------------------- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskContext.java | 88 ---------------------------------------------------------------------------------------- src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskletContext.java | 62 -------------------------------------------------------------- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java | 97 ------------------------------------------------------------------------------------------------- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java | 43 ------------------------------------------- src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java | 86 -------------------------------------------------------------------------------------- 14 files changed, 821 deletions(-) delete mode 100644 src/main/java/mvd/jester/simulator/AbstractSimulator.java delete mode 100644 src/main/java/mvd/jester/simulator/DynamicForkJoin.java delete mode 100644 src/main/java/mvd/jester/simulator/ParallelSynchronous.java delete mode 100644 src/main/java/mvd/jester/simulator/SimulatorInterface.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/SortedTaskContextSet.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskletContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java delete mode 100644 src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java diff --git a/src/main/java/mvd/jester/simulator/AbstractSimulator.java b/src/main/java/mvd/jester/simulator/AbstractSimulator.java deleted file mode 100644 index 417192c..0000000 --- a/src/main/java/mvd/jester/simulator/AbstractSimulator.java +++ /dev/null @@ -1,129 +0,0 @@ -// package mvd.jester.simulator; - -// import java.util.Comparator; -// import java.util.HashSet; -// import java.util.Set; -// import java.util.TreeSet; -// import com.google.common.collect.TreeMultiset; -// import mvd.jester.model.SystemManager; -// import mvd.jester.priority.PriorityManager; -// import mvd.jester.priority.RateMonotonic; -// import mvd.jester.TypeInterface; -// import mvd.jester.info.SchedulingInfo; -// import mvd.jester.simulator.model.ProcessorContext; -// import mvd.jester.simulator.internals.ITaskContext; - - -// /** -// * AbstractSimulator -// */ -// public abstract class AbstractSimulator implements SimulatorInterface, TypeInterface { - -// protected final SystemManager systemSetup; -// protected final Set processors; -// protected TreeMultiset readyTasks; - -// AbstractSimulator(SystemManager systemSetup) { -// this.systemSetup = systemSetup; -// this.readyTasks = TreeMultiset.create((t1, t2) -> new RateMonotonic().compare(t1, t2)); -// processors = new HashSet<>(); -// for (int i = 0; i < systemSetup.getNumberOfProcessors(); ++i) { -// processors.add(new ProcessorContext(i)); -// } -// } - - -// protected abstract boolean releaseTasks(long timeStep); - -// @Override -// public SchedulingInfo runSimulation(PriorityManager priorityManager) { -// // SchedulingInfo schedulingInfo = new SchedulingInfo(systemSetup.getParallelTaskRatio(), -// // systemSetup.getUtilization()); -// // long hyperPeriod = init(priorityManager); -// // for (int t = 0; t < hyperPeriod; ++t) { -// // if (!releaseTasks(t)) { -// // throw new RuntimeException("Could not release a task. This should not happen!"); -// // } - -// // Set sortedProcessors = sortProcessors(processors); - -// // for (ProcessorContext p : sortedProcessors) { -// // for (TaskContextInterface tc : readyTasks) { -// // if (p.acceptTask(tc, t)) { -// // break; -// // } -// // } - -// // } - -// // for (ProcessorContext p : processors) { -// // Optional optionalTc = p.updateExecution(t); -// // if (optionalTc.isPresent()) { -// // TaskContextInterface tc = optionalTc.get(); -// // if (t >= tc.getDeadline()) { -// // TerminationInfo terminationInfo = -// // new TerminationInfo(tc.getReleaseTime(), tc.getDeadline(), t); -// // schedulingInfo.addTerminationInfo(terminationInfo); - - -// // EventPrinter.print("Time " + t + ": Task " + tc + " failed its deadline!"); -// // schedulingInfo.setFailedTerminationInfo(terminationInfo); -// // return schedulingInfo; -// // } - -// // readyTasks.remove(optionalTc.get()); -// // } -// // } -// // } - -// // return schedulingInfo; -// return null; -// } - -// private long init(PriorityManager priorityManager) { -// this.readyTasks = TreeMultiset.create((t1, t2) -> priorityManager.compare(t1, t2)); -// for (ProcessorContext p : processors) { -// p.setJob(null); -// } -// return getHyperPeriod(); -// } - -// private Set sortProcessors(Set processors) { -// Set sortedProcessors = new TreeSet<>(new ProcessorComparator()); - -// processors.forEach(p -> sortedProcessors.add(p)); - -// return sortedProcessors; -// } - -// private long getHyperPeriod() { -// // return -// // systemSetup.getTasks().stream().max(Comparator.comparing(SynchronousTask::getPeriod)) -// // .get().getPeriod() * 10; -// return 10; -// } - - - -// private class ProcessorComparator implements Comparator { - -// @Override -// public int compare(ProcessorContext p1, ProcessorContext p2) { -// if (!p1.getSubtask().isPresent()) { -// return -1; -// } else if (!p2.getSubtask().isPresent()) { -// return 1; -// } else { -// long p1Period = p1.getSubtask().get().getJobContext().getTask().getPeriod(); -// long p2Period = p2.getSubtask().get().getJobContext().getTask().getPeriod(); -// if (p1Period == p2Period) { -// return 1; -// } else { -// return (int) (p2.getSubtask().get().getJobContext().getTask().getPeriod() -// - p1.getSubtask().get().getJobContext().getTask().getPeriod()); -// } -// } -// } - -// } -// } diff --git a/src/main/java/mvd/jester/simulator/DynamicForkJoin.java b/src/main/java/mvd/jester/simulator/DynamicForkJoin.java deleted file mode 100644 index 2429fa1..0000000 --- a/src/main/java/mvd/jester/simulator/DynamicForkJoin.java +++ /dev/null @@ -1,37 +0,0 @@ -// package mvd.jester.simulator; - - -// import mvd.jester.model.SystemManager; - -// /** -// * SchmidMottok -// */ -// public class DynamicForkJoin extends AbstractSimulator { - -// public DynamicForkJoin(SystemManager systemSetup) { -// super(systemSetup); -// } - - -// @Override -// protected boolean releaseTasks(long timeStep) { -// // // for (SynchronousTask t : systemSetup.getTasks()) { -// // if (timeStep % t.getPeriod() == 0) { -// // TaskContext tc = new TaskContext(t, systemSetup.getNumberOfProcessors(), timeStep); -// // if (!readyTasks.add(tc)) { -// // EventPrinter -// // .print("Time " + timeStep + ": Task " + tc + " could not be released!"); -// // return false; -// // } -// // EventPrinter.print("Time " + timeStep + ": Task " + tc + " released!"); -// // } -// // } -// return true; -// } - - -// @Override -// public String getName() { -// return "SchmidMottok"; -// } -// } diff --git a/src/main/java/mvd/jester/simulator/GlobalScheduler.java b/src/main/java/mvd/jester/simulator/GlobalScheduler.java index 9acab73..7512d1d 100644 --- a/src/main/java/mvd/jester/simulator/GlobalScheduler.java +++ b/src/main/java/mvd/jester/simulator/GlobalScheduler.java @@ -4,9 +4,7 @@ import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; -import java.util.SortedSet; import java.util.TreeSet; -import java.util.stream.Collector; import java.util.stream.Collectors; import org.jgrapht.Graphs; import mvd.jester.model.DagTask; diff --git a/src/main/java/mvd/jester/simulator/ParallelSynchronous.java b/src/main/java/mvd/jester/simulator/ParallelSynchronous.java deleted file mode 100644 index 55367bc..0000000 --- a/src/main/java/mvd/jester/simulator/ParallelSynchronous.java +++ /dev/null @@ -1,36 +0,0 @@ -// package mvd.jester.simulator; - -// import mvd.jester.model.SystemManager; - -// /** -// * MaiaBertogna -// */ -// public class ParallelSynchronous extends AbstractSimulator { - -// public ParallelSynchronous(SystemManager systemSetup) { -// super(systemSetup); -// } - -// @Override -// protected boolean releaseTasks(long timeStep) { -// // for (SynchronousTask t : systemSetup.getTasks()) { -// // if (timeStep % t.getPeriod() == 0) { -// // TaskContext tc = new TaskContext(t, timeStep); -// // if (!readyTasks.add(tc)) { -// // EventPrinter -// // .print("Time " + timeStep + ": Task " + tc + " could not be released!"); -// // return false; -// // } -// // EventPrinter.print("Time " + timeStep + ": Task " + tc + " released!"); -// // } -// // } -// return true; -// } - -// @Override -// public String getName() { -// return "MaiaBertogna"; -// } - - -// } diff --git a/src/main/java/mvd/jester/simulator/SimulatorInterface.java b/src/main/java/mvd/jester/simulator/SimulatorInterface.java deleted file mode 100644 index f95461a..0000000 --- a/src/main/java/mvd/jester/simulator/SimulatorInterface.java +++ /dev/null @@ -1,15 +0,0 @@ -package mvd.jester.simulator; - -import mvd.jester.info.SchedulingInfo; -import mvd.jester.priority.PriorityManager; - -/** - * SimulatorInterface - */ -public interface SimulatorInterface { - - public SchedulingInfo runSimulation(PriorityManager priorityManager); - - public String getName(); - -} diff --git a/src/main/java/mvd/jester/simulator/events/ISubtaskEvent.java b/src/main/java/mvd/jester/simulator/events/ISubtaskEvent.java index c7990ec..4a3cb83 100644 --- a/src/main/java/mvd/jester/simulator/events/ISubtaskEvent.java +++ b/src/main/java/mvd/jester/simulator/events/ISubtaskEvent.java @@ -1,6 +1,5 @@ package mvd.jester.simulator.events; -import mvd.jester.simulator.model.ExtendedSubtaskContext; import mvd.jester.simulator.model.JobContext; public interface ISubtaskEvent extends IEvent { diff --git a/src/main/java/mvd/jester/simulator/internals/SortedTaskContextSet.java b/src/main/java/mvd/jester/simulator/internals/SortedTaskContextSet.java deleted file mode 100644 index 9281852..0000000 --- a/src/main/java/mvd/jester/simulator/internals/SortedTaskContextSet.java +++ /dev/null @@ -1,17 +0,0 @@ -// package mvd.jester.simulator.internals; - -// import java.util.TreeSet; -// import mvd.jester.priority.PriorityManager; - -// /** -// * SortedTaskContextSet -// */ -// public class SortedTaskContextSet extends TreeSet { - -// private static final long serialVersionUID = 4808544133562675597L; - -// public SortedTaskContextSet(PriorityManager priorityMananger) { -// super((t1, t2) -> priorityMananger.compare(t1, t2)); -// } -// } - diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java deleted file mode 100644 index 19bd189..0000000 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java +++ /dev/null @@ -1,129 +0,0 @@ -// package mvd.jester.simulator.internals.dynamicforkjoin; - -// import java.util.Optional; -// import mvd.jester.simulator.EventPrinter; -// import mvd.jester.simulator.internals.ISubtaskContext; -// import mvd.jester.simulator.internals.ProcessorContext; -// import mvd.jester.simulator.internals.ITaskContext; - -// /** -// * Job -// * -// * @param -// */ -// public class JobContext implements ISubtaskContext { - -// private final TaskContext taskContext; -// private final SegmentContext segmentContext; -// private final long wcet; -// private Optional currentProcessor; -// private Optional currentTasklet; - - -// public JobContext(TaskContext taskContext, SegmentContext segmentContext) { -// this.currentProcessor = Optional.empty(); -// this.currentTasklet = Optional.empty(); -// this.taskContext = taskContext; -// this.segmentContext = segmentContext; -// this.wcet = segmentContext.getSegment().getJobWcet(); -// } - -// public Optional updateExecution(long time) { -// boolean jobIsIdle = true; -// if (currentTasklet.isPresent()) { -// jobIsIdle = currentTasklet.get().updateExecution(time); -// } - -// if (jobIsIdle) { -// currentTasklet = segmentContext.getNextTasklet(); -// Optional tc = taskContext.acceptNotification(time); - -// if (currentTasklet.isPresent()) { -// EventPrinter.print("Time " + time + ": Job " + this + " started executing tasklet " -// + currentTasklet.get() + " on Processor " + currentProcessor.get()); -// currentTasklet.get().setCurrentJob(this); -// } else { -// if (currentProcessor.isPresent()) { -// currentProcessor.get().setJob(null); -// } -// currentProcessor = Optional.empty(); -// return tc; -// } -// } - -// return Optional.empty(); -// } - -// public boolean checkExecutionTime() { -// if (currentTasklet.isPresent()) { -// return currentTasklet.get().checkExecutionTime(); -// } -// return false; -// } - -// /** -// * @return the wcet -// */ -// public long getWcet() { -// return wcet; -// } - -// /** -// * @param processor the currentProcessor to set -// */ -// public void setCurrentProcessor(ProcessorContext processor) { -// this.currentProcessor = Optional.ofNullable(processor); -// } - -// /** -// * @return the currentProcessor -// */ -// public Optional getCurrentProcessor() { -// return currentProcessor; -// } - -// /** -// * @param currentTasklet the currentTasklet to set -// */ -// public void setCurrentTasklet(TaskletContext currentTasklet) { -// this.currentTasklet = Optional.ofNullable(currentTasklet); -// } - -// /** -// * @return the segmentContext -// */ -// public SegmentContext getSegmentContext() { -// return segmentContext; -// } - - -// /** -// * @return the taskContext -// */ -// public TaskContext getTaskContext() { -// return taskContext; -// } - -// @Override -// public String toString() { -// return "(of task=" + taskContext + ")"; -// } - -// @Override -// public boolean prepareJob(long time) { -// if (!currentTasklet.isPresent()) { -// currentTasklet = segmentContext.getNextTasklet(); -// if (currentTasklet.isPresent()) { -// currentTasklet.get().setCurrentJob(this); -// // EventPrinter.print("Time " + time + ": Job " + this + " started executing -// // tasklet" -// // + currentTasklet.get()); -// return true; -// } else { -// return false; -// } -// } -// return true; -// } - -// } diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java deleted file mode 100644 index 316aadd..0000000 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java +++ /dev/null @@ -1,79 +0,0 @@ -// package mvd.jester.simulator.internals.dynamicforkjoin; - -// import java.util.HashSet; -// import java.util.Optional; -// import java.util.Set; -// import mvd.jester.model.Segment; -// import mvd.jester.simulator.internals.ISubtaskContext; - -// /** -// * Segment -// */ -// public class SegmentContext { -// private final Segment segment; -// private final Set jobs; -// private final Set tasklets; - -// public SegmentContext(TaskContext taskContext, Segment segment, long numberOfProcessors) { -// this.segment = segment; -// jobs = new HashSet<>(); -// tasklets = new HashSet<>(); - -// long numberOfJobs = segment.getNumberOfJobs() > numberOfProcessors ? numberOfProcessors -// : segment.getNumberOfJobs(); - -// for (int j = 0; j < numberOfJobs; ++j) { -// jobs.add(new JobContext(taskContext, this)); -// } - -// // for (int j = 0; j < segment.getNumberOfTasklets(); ++j) { -// // tasklets.add(new TaskletContext(taskContext, this)); -// // } -// } - - -// /** -// * @return the segment -// */ -// public Segment getSegment() { -// return segment; -// } - -// public long getNumberOfJobs() { -// return jobs.size(); -// } - -// public Optional getNextJob() { -// boolean taskletAvailable = tasklets.stream() -// .anyMatch(t -> !t.getCurrentJob().isPresent() && t.checkExecutionTime()); - -// boolean jobNotFinished = jobs.stream() -// .anyMatch(j -> !j.getCurrentProcessor().isPresent() && j.checkExecutionTime()); - -// if (jobNotFinished) { -// return jobs.stream() -// .filter(j -> !j.getCurrentProcessor().isPresent() && j.checkExecutionTime()) -// .findFirst(); -// } else if (taskletAvailable) { -// return jobs.stream() -// .filter(j -> !j.getCurrentProcessor().isPresent() && !j.checkExecutionTime()) -// .findFirst(); -// } else { -// return Optional.empty(); -// } -// } - -// public Optional getNextTasklet() { -// return tasklets.stream() -// .filter(t -> !t.getCurrentJob().isPresent() && t.checkExecutionTime()).findFirst(); -// } - - - -// @Override -// public String toString() { -// return "something"; -// // return "(nJobs=" + segment.getNumberOfJobs() + ", nTasklets=" -// // + segment.getNumberOfTasklets() + ", taskletWcet=" + segment.getTaskletWcet() + ")"; -// } -// } diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskContext.java deleted file mode 100644 index 31bca5d..0000000 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskContext.java +++ /dev/null @@ -1,88 +0,0 @@ -// package mvd.jester.simulator.internals.dynamicforkjoin; - -// import java.util.ArrayList; -// import java.util.Optional; -// import mvd.jester.model.Segment; -// import mvd.jester.model.SynchronousTask; -// import mvd.jester.simulator.EventPrinter; -// import mvd.jester.simulator.internals.ISubtaskContext; -// import mvd.jester.simulator.internals.ITaskContext; - -// /** -// * TaskContext -// */ -// public class TaskContext implements ITaskContext { - -// private final SynchronousTask task; -// private final ArrayList segments; -// private final long releaseTime; -// private final long deadline; -// private int currentSegment; -// private int segmentCounter; - - -// public TaskContext(SynchronousTask task, long numberOfProcessors, long releaseTime) { -// this.task = task; -// this.segments = new ArrayList<>(); -// this.currentSegment = 0; -// this.segmentCounter = 0; -// this.deadline = releaseTime + task.getDeadline(); -// this.releaseTime = releaseTime; - -// for (Segment s : task.getWorkloadDistribution()) { -// segments.add(new SegmentContext(this, s, numberOfProcessors)); -// } -// } - -// /** -// * @return the task -// */ -// public SynchronousTask getTask() { -// return task; -// } - -// /** -// * @return the deadline -// */ -// @Override -// public long getDeadline() { -// return deadline; -// } - -// @Override -// public long getReleaseTime() { -// return releaseTime; -// } - -// public Optional acceptNotification(long time) { -// segmentCounter++; - -// // if (segmentCounter >= segments.get(currentSegment).getSegment().getNumberOfTasklets()) { -// // currentSegment++; -// // segmentCounter = 0; -// // if (currentSegment >= segments.size()) { -// // EventPrinter.print("Time " + time + ": Task " + this + "finished!"); -// // return Optional.of(this); -// // } -// // } - - -// return Optional.empty(); -// } - -// public Optional getNextJob() { -// if (currentSegment < segments.size()) { -// return segments.get(currentSegment).getNextJob(); -// } - -// return Optional.empty(); -// } - - -// @Override -// public String toString() { -// return "(period=" + task.getPeriod() + ", deadline=" + deadline + ", segments=" -// + segments.size() + ")"; -// } - -// } diff --git a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskletContext.java b/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskletContext.java deleted file mode 100644 index f84b439..0000000 --- a/src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/TaskletContext.java +++ /dev/null @@ -1,62 +0,0 @@ -// package mvd.jester.simulator.internals.dynamicforkjoin; - -// import java.util.Optional; - -// /** -// * Tasklet -// */ -// public class TaskletContext { - -// private final TaskContext taskContext; -// private Optional currentJob; -// private final long wcet; -// private long executionTime; - - -// public TaskletContext(TaskContext taskContext, SegmentContext segment) { -// this.taskContext = taskContext; -// this.wcet = 88; -// // segment.getSegment().getTaskletWcet(); -// this.executionTime = wcet; -// currentJob = Optional.empty(); -// } - - -// /** -// * @return the currentJob -// */ -// public Optional getCurrentJob() { -// return currentJob; -// } - -// public void setCurrentJob(JobContext jobContext) { -// currentJob = Optional.ofNullable(jobContext); -// } - -// /** -// * @return true if tasklet finished, false otherwise -// */ -// public boolean updateExecution(long time) { -// executionTime--; - -// if (executionTime == 0) { -// if (currentJob.isPresent()) { -// currentJob.get().setCurrentTasklet(null); -// } -// currentJob = Optional.empty(); -// return true; -// } else if (executionTime < 0) { -// throw new RuntimeException("Tasklet was executed for longer than its WCET!"); -// } -// return false; -// } - -// public boolean checkExecutionTime() { -// return executionTime > 0; -// } - -// @Override -// public String toString() { -// return "(wcet=" + wcet + ", task=" + taskContext + ")"; -// } -// } diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java deleted file mode 100644 index 387fc7d..0000000 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java +++ /dev/null @@ -1,97 +0,0 @@ -// package mvd.jester.simulator.internals.parallelsynchronous; - -// import java.util.Optional; -// import mvd.jester.simulator.EventPrinter; -// import mvd.jester.simulator.internals.ISubtaskContext; -// import mvd.jester.simulator.internals.ProcessorContext; -// import mvd.jester.simulator.internals.ITaskContext; - -// /** -// * Job -// * -// * @param -// */ -// public class JobContext implements ISubtaskContext { - -// private final TaskContext taskContext; -// private final SegmentContext segmentContext; -// private final long wcet; -// private Optional currentProcessor; -// private long executionTime; - - -// public JobContext(TaskContext taskContext, SegmentContext segmentContext) { -// this.currentProcessor = Optional.empty(); -// this.taskContext = taskContext; -// this.segmentContext = segmentContext; -// this.wcet = segmentContext.getSegment().getJobWcet(); -// this.executionTime = wcet; -// } - -// public Optional updateExecution(long time) { -// executionTime--; - -// if (executionTime == 0) { -// EventPrinter.print("Time " + time + ": " + currentProcessor.get() -// + " finished execution of job " + this + "!"); -// currentProcessor.get().setJob(null); -// currentProcessor = Optional.empty(); -// return taskContext.acceptNotification(time); -// } else if (executionTime < 0) { -// throw new RuntimeException("Job was executed for longer than its WCET!"); -// } - -// return Optional.empty(); -// } - -// public boolean checkExecutionTime() { -// return executionTime > 0; -// } - -// /** -// * @return the wcet -// */ -// public long getWcet() { -// return wcet; -// } - -// /** -// * @param processor the currentProcessor to set -// */ -// public void setCurrentProcessor(ProcessorContext processor) { -// this.currentProcessor = Optional.ofNullable(processor); -// } - -// /** -// * @return the currentProcessor -// */ -// public Optional getCurrentProcessor() { -// return currentProcessor; -// } - -// /** -// * @return the segmentContext -// */ -// public SegmentContext getSegmentContext() { -// return segmentContext; -// } - - -// /** -// * @return the taskContext -// */ -// public TaskContext getTaskContext() { -// return taskContext; -// } - -// @Override -// public String toString() { -// return "(jobWcet=" + wcet + ", of task=" + taskContext + ")"; -// } - -// @Override -// public boolean prepareJob(long time) { -// return true; -// } - -// } diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java deleted file mode 100644 index 600bfd6..0000000 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java +++ /dev/null @@ -1,43 +0,0 @@ -// package mvd.jester.simulator.internals.parallelsynchronous; - -// import java.util.HashSet; -// import java.util.Optional; -// import java.util.Set; -// import mvd.jester.model.Segment; -// import mvd.jester.simulator.internals.ISubtaskContext; - -// /** -// * Segment -// */ -// public class SegmentContext { -// private final Segment segment; -// private final Set jobs; - -// public SegmentContext(TaskContext taskContext, Segment segment) { -// this.segment = segment; -// jobs = new HashSet<>(); - -// for (int j = 0; j < segment.getNumberOfJobs(); ++j) { -// jobs.add(new JobContext(taskContext, this)); -// } -// } - - -// /** -// * @return the segment -// */ -// public Segment getSegment() { -// return segment; -// } - -// public Optional getNextJob() { -// return jobs.stream() -// .filter(j -> !j.getCurrentProcessor().isPresent() && j.checkExecutionTime()) -// .findFirst(); -// } - -// @Override -// public String toString() { -// return "(nJobs=" + segment.getNumberOfJobs() + ", jobWcet=" + segment.getJobWcet() + ")"; -// } -// } diff --git a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java b/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java deleted file mode 100644 index 14368dc..0000000 --- a/src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java +++ /dev/null @@ -1,86 +0,0 @@ -// package mvd.jester.simulator.internals.parallelsynchronous; - -// import java.util.ArrayList; -// import java.util.Optional; -// import mvd.jester.model.Segment; -// import mvd.jester.model.SynchronousTask; -// import mvd.jester.simulator.EventPrinter; -// import mvd.jester.simulator.internals.ISubtaskContext; -// import mvd.jester.simulator.internals.ITaskContext; - -// /** -// * TaskContext -// */ -// public class TaskContext implements ITaskContext { - -// private final SynchronousTask task; -// private final ArrayList segments; -// private final long deadline; -// private final long releaseTime; -// private int currentSegment; -// private int segmentCounter; - -// public TaskContext(SynchronousTask task, long releaseTime) { -// this.task = task; -// this.segments = new ArrayList<>(); -// this.currentSegment = 0; -// this.segmentCounter = 0; -// this.releaseTime = releaseTime; -// this.deadline = releaseTime + task.getDeadline(); - -// for (Segment s : task.getWorkloadDistribution()) { -// segments.add(new SegmentContext(this, s)); -// } -// } - -// /** -// * @return the task -// */ -// public SynchronousTask getTask() { -// return task; -// } - -// /** -// * @return the deadline -// */ -// @Override -// public long getDeadline() { -// return deadline; -// } - -// @Override -// public long getReleaseTime() { -// return releaseTime; -// } - -// public Optional acceptNotification(long time) { -// segmentCounter++; - -// if (segmentCounter >= segments.get(currentSegment).getSegment().getNumberOfJobs()) { -// currentSegment++; -// segmentCounter = 0; -// if (currentSegment >= segments.size()) { -// EventPrinter.print("Time " + time + ": Task " + this + "finished!"); -// return Optional.of(this); -// } -// } - - -// return Optional.empty(); -// } - -// public Optional getNextJob() { -// if (currentSegment < segments.size()) { -// return segments.get(currentSegment).getNextJob(); -// } - -// return Optional.empty(); -// } - - -// @Override -// public String toString() { -// return "(period=" + task.getPeriod() + ", deadline=" + deadline + ", segments=" -// + segments.size() + ")"; -// } -// } -- libgit2 0.26.0