public class GanttChart
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
GanttChart.Record
Record of each task in the Gantt chart.
|
Modifier and Type | Field and Description |
---|---|
boolean |
addLegendInGraph
Add legend in the Gantt chart
|
boolean |
addNamesToActorInGraph
Add name to the Gantt chart
|
java.util.HashMap<java.lang.String,java.lang.String> |
colorBook
Colors mapped to tasks.
|
private java.lang.String[] |
defaultColors
Random set of colors encoded in Hex.
|
boolean |
generatePdfOutput
Generate PDF output.
|
private java.util.HashMap<java.lang.Integer,java.lang.String> |
processorNames
Name of each processor
|
private java.util.HashMap<java.lang.Integer,java.lang.Double> |
processors
Position of processor in the Gantt chart
|
(package private) java.util.Random |
randomNumberGen
Random number generator
|
private java.util.List<GanttChart.Record> |
records
List of records to generate Gantt Chart.
|
double |
taskBoxHeight
Height of the task in the Gantt chart
|
private java.util.HashSet<java.lang.String> |
tasks
Name of tasks
|
int |
textRotationAngle
Rotate text in the Gantt chart by this angle
|
Constructor and Description |
---|
GanttChart()
Initialize data structures for Gantt chart object
|
Modifier and Type | Method and Description |
---|---|
void |
addRecord(GanttChart.Record record)
Add a record to the list.
|
private void |
buildRecordsFromModel(java.util.Map<java.lang.String,java.lang.String> model,
java.util.Map<java.lang.String,java.lang.Integer> taskDuration)
Build records from the model
|
private void |
calculateRectangles()
Calculate the rectangles in the Gantt chart.
|
private double |
calculateXMax()
Calculate the maximum value for the X-axis of the Gantt chart.
|
private void |
chartGeneration(java.lang.String outputFileName,
int period)
Generate the Gantt chart.
|
private void |
generateColorBook()
Assign a color to each actor.
|
private void |
generatePdf(java.lang.String outputFileName)
Generate PDF from GNU plot.
|
private void |
generateUniqueTasksAndProcs()
Generate unique tasks and processors from the records
|
private void |
genereteGnuConfigFile(java.lang.String fileName,
int period)
Method to generate GNU plot file.
|
private java.lang.String |
pickRandomColor()
Pick up a random color from the color book we have.
|
void |
plotChart(java.util.Map<java.lang.String,java.lang.String> model,
Graph sdfGraph,
java.lang.String outputFileName)
Plot the Gantt chart
|
void |
plotChart(java.util.Map<java.lang.String,java.lang.String> model,
java.util.Map<java.lang.String,java.lang.Integer> taskDuration,
java.lang.String outputFileName,
int period)
Plot the Gantt chart from the model and task durations.
|
void |
plotChart(java.lang.String outputFileName,
int period)
Plot the Gantt chart.
|
public boolean addNamesToActorInGraph
public boolean addLegendInGraph
public final double taskBoxHeight
public int textRotationAngle
public boolean generatePdfOutput
private java.util.HashSet<java.lang.String> tasks
private java.util.HashMap<java.lang.Integer,java.lang.Double> processors
private java.util.HashMap<java.lang.Integer,java.lang.String> processorNames
public java.util.HashMap<java.lang.String,java.lang.String> colorBook
private java.util.List<GanttChart.Record> records
java.util.Random randomNumberGen
private final java.lang.String[] defaultColors
private void genereteGnuConfigFile(java.lang.String fileName, int period)
fileName
- name of output GNU plot fileperiod
- period from the model.private void generatePdf(java.lang.String outputFileName)
outputFileName
- output PDF file nameprivate java.lang.String pickRandomColor()
private void generateColorBook()
private void calculateRectangles()
private void generateUniqueTasksAndProcs()
private double calculateXMax()
private void chartGeneration(java.lang.String outputFileName, int period)
outputFileName
- output file name for GNU plot fileperiod
- period of the schedule, -1 for non-pipelined schedulepublic void addRecord(GanttChart.Record record)
record
- record to be addedpublic void plotChart(java.util.Map<java.lang.String,java.lang.String> model, Graph sdfGraph, java.lang.String outputFileName)
model
- Model containing the schedulesdfGraph
- SDF graphoutputFileName
- output file namepublic void plotChart(java.lang.String outputFileName, int period)
outputFileName
- output file nameperiod
- period of the schedule, -1 for non-pipelined schedulepublic void plotChart(java.util.Map<java.lang.String,java.lang.String> model, java.util.Map<java.lang.String,java.lang.Integer> taskDuration, java.lang.String outputFileName, int period)
model
- Model containing start times and processor allocationstaskDuration
- duration of tasksoutputFileName
- output file nameperiod
- period of the schedule, -1 for non-pipelinedprivate void buildRecordsFromModel(java.util.Map<java.lang.String,java.lang.String> model, java.util.Map<java.lang.String,java.lang.Integer> taskDuration)
model
- model containing start times and processor allocationstaskDuration
- task durations