public class ListScheduling
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ListScheduling.Strategy
Strategy to select the tasks from ready list.
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<Actor> |
allocatedActorList
Tasks already allocated
|
private Graph |
hsdf
An equivalent HSDF graph
|
(package private) java.util.List<Actor> |
nonAllocatedActorList
Non allocated Tasks
|
private java.util.Map<Actor,java.util.HashSet<Actor>> |
predecessors
List of predecessors of an actor
|
private int[] |
processorTime
Latest time available on processors
|
private java.util.Map<Actor,java.lang.Integer> |
randomStrategyOrder
assigns random unique index for each actor
|
(package private) java.util.List<Actor> |
readyList
Ready list for scheduling
|
private java.util.Map<Actor,java.lang.Integer[]> |
schedule
Schedule produced
|
private Graph |
sdf
Input SDF graph
|
java.util.List<ListScheduling.Strategy> |
selectionStrategies
list of strategies to be applied on top of random
|
private Solutions |
solutions
Solutions of SDF GRAPH
|
Constructor and Description |
---|
ListScheduling(Graph sdfGraph)
Initialize list-scheduling algorithm.
|
Modifier and Type | Method and Description |
---|---|
private int |
calculateBuffer(java.util.Map<java.lang.String,java.lang.String> model)
Calculate the buffer size for the schedule
|
private void |
calculateReadyActors(int time)
Calculate ready actors
|
private int |
compareByStrategy(ListScheduling.Strategy strategy,
Actor actor1,
Actor actor2)
This functions supports the comparator to select an actor
between multiple ready actors.
|
private void |
computeRandomStrategy() |
private java.util.Map<java.lang.String,java.lang.String> |
generateModel()
Generate a model from the schedule.
|
private void |
generatePredecessorsList()
Generate a list of all predecessors
|
java.util.Map<java.lang.String,java.lang.String> |
generateSchedule(int numProcessors)
Generate a schedule using list scheduling for fixed number of processors
|
private int |
getMinStartTime(Actor readyActor)
Depending on when the predecessors end, calculate the start time for the actor.
|
private int |
getTimeIncrement(int numProcessors,
int forProcessor)
Function to increment the time of the processor in case there is no ready actor.
|
private int |
selectProcWithMinTime(int[] processorTime)
Find processor available with minimum start time
|
private Actor |
selectReadyActor()
This function selects actor from the ready list.
|
private Graph sdf
private Solutions solutions
private Graph hsdf
private java.util.Map<Actor,java.util.HashSet<Actor>> predecessors
java.util.List<Actor> readyList
java.util.List<Actor> allocatedActorList
java.util.List<Actor> nonAllocatedActorList
private java.util.Map<Actor,java.lang.Integer[]> schedule
private int[] processorTime
private java.util.Map<Actor,java.lang.Integer> randomStrategyOrder
public java.util.List<ListScheduling.Strategy> selectionStrategies
public ListScheduling(Graph sdfGraph)
sdfGraph
- input SDF graphprivate void generatePredecessorsList()
public java.util.Map<java.lang.String,java.lang.String> generateSchedule(int numProcessors)
numProcessors
- number of processorsprivate int getTimeIncrement(int numProcessors, int forProcessor)
numProcessors
- total number of processorsforProcessor
- the processor for which the time should be incrementedprivate int calculateBuffer(java.util.Map<java.lang.String,java.lang.String> model)
model
- schedule containing tasks and their start timesprivate java.util.Map<java.lang.String,java.lang.String> generateModel()
private Actor selectReadyActor()
private void computeRandomStrategy()
private int compareByStrategy(ListScheduling.Strategy strategy, Actor actor1, Actor actor2)
strategy
- strategy to compare the actorsactor1
- an actoractor2
- other actorprivate int getMinStartTime(Actor readyActor)
readyActor
- ready actor selectedprivate void calculateReadyActors(int time)
time
- current timeprivate int selectProcWithMinTime(int[] processorTime)
processorTime
- array with processor times