Ignore:
Timestamp:
08/13/13 12:45:58 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java

    r1153 r1193  
    22 
    33import java.awt.Color; 
     4import java.awt.Font; 
    45import java.awt.Paint; 
     6import java.awt.geom.Rectangle2D; 
    57import java.io.File; 
    68import java.io.FileOutputStream; 
     
    1416import java.util.Date; 
    1517import java.util.HashMap; 
     18import java.util.Iterator; 
    1619import java.util.List; 
    1720import java.util.Map; 
     
    2629import org.jfree.chart.ChartUtilities; 
    2730import org.jfree.chart.JFreeChart; 
     31import org.jfree.chart.LegendItem; 
    2832import org.jfree.chart.axis.AxisLocation; 
     33import org.jfree.chart.axis.CategoryAxis; 
    2934import org.jfree.chart.axis.DateAxis; 
    3035import org.jfree.chart.axis.NumberAxis; 
     36import org.jfree.chart.axis.NumberTickUnit; 
     37import org.jfree.chart.axis.ValueAxis; 
    3138import org.jfree.chart.encoders.ImageFormat; 
    3239import org.jfree.chart.labels.CategoryItemLabelGenerator; 
     
    4148import org.jfree.chart.renderer.category.GanttRenderer; 
    4249import org.jfree.chart.renderer.xy.XYStepAreaRenderer; 
     50import org.jfree.chart.title.LegendTitle; 
    4351import org.jfree.chart.title.TextTitle; 
    4452import org.jfree.chart.title.Title; 
     
    8694import simulator.stats.implementation.out.CoolEmAllStringSerializer; 
    8795import simulator.stats.implementation.out.StringSerializer; 
     96import test.article.recs.utils.TaskToApp; 
    8897import csiro.mit.utils.jfreechart.timetablechart.TimetableChartFactory; 
    8998import csiro.mit.utils.jfreechart.timetablechart.data.Timetable; 
     
    393402                                                EnergyExtension een = (EnergyExtension)(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION)); 
    394403                                                if(resourceController.getComputingResources().contains(resource)) { 
    395                                                         if( een != null /*&& een.getPp() != null*/ ){ 
    396                                                                 accStats.meanAirFlow.add(airFlow.getSumValue()); 
     404                                                        if( een != null && een.getAirFlowProfile() != null &&  een.getPowerProfile().getEnergyEstimationPlugin() != null){ 
     405                                                                accStats.meanAirFlow.add(airFlow.getMeanValue()); 
    397406                                                        } 
    398407 
     
    409418                                                        } 
    410419                                                        if(top == true){ 
    411                                                                 accStats.meanAirFlow.add(airFlow.getSumValue()); 
     420                                                                accStats.meanAirFlow.add(airFlow.getMeanValue()); 
    412421                                                        } 
    413422                                                } 
     
    431440                                                EnergyExtension een = (EnergyExtension)(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION)); 
    432441                                                if(resourceController.getComputingResources().contains(resource)) { 
    433                                                         if( een != null /*&& een.getPp() != null*/ ){ 
    434                                                                 accStats.meanTemperature.add(temperature.getSumValue()); 
     442                                                        if( een != null  && een.getThermalProfile() != null &&  een.getPowerProfile().getEnergyEstimationPlugin() != null){ 
     443                                                                accStats.meanTemperature.add(temperature.getMeanValue()); 
    435444                                                        } 
    436445 
     
    447456                                                        } 
    448457                                                        if(top == true){ 
    449                                                                 accStats.meanTemperature.add(temperature.getSumValue()); 
     458                                                                accStats.meanTemperature.add(temperature.getMeanValue()); 
    450459                                                        } 
    451460                                                } 
     
    465474                } 
    466475                 
    467                 saveResourceGanttDiagrams(); 
     476                saveResourceUsageDiagrams(); 
    468477                createAccumulatedResourceSimulationStatistic(); 
    469478                 
     
    559568        //change this method to adjust the colors of gantt chart 
    560569        private String getUniqueTaskId(ExecTask execTask){ 
    561                 return execTask.getJobId() + "_" + execTask.getId(); 
     570                String taskId = execTask.getJobId() + "_" + execTask.getId(); 
     571                /*if(execTask.getApplicationName() != null){ 
     572                        taskId = execTask.getApplicationName(); 
     573                } else { 
     574                        taskId = execTask.getJobId() + "_" + execTask.getId(); 
     575                }*/ 
     576                return taskId; 
    562577        } 
    563578         
     
    815830        } 
    816831 
    817         private boolean saveResourceGanttDiagrams() { 
     832        private boolean saveResourceUsageDiagrams() { 
    818833 
    819834                if (!generateDiagrams) 
     
    942957 
    943958                CombinedDomainXYPlot cPlot = (CombinedDomainXYPlot) c.getPlot(); 
     959 
     960                /*Font fontt=new Font("Arial",Font.BOLD,26); 
     961                 
     962                c.getTitle().setFont(fontt); 
     963                Font font=new Font("Arial",0,20); 
     964                 
     965                CombinedDomainXYPlot p = (CombinedDomainXYPlot)c.getPlot(); 
     966                ValueAxis daxis = p.getDomainAxis(); 
     967                daxis.setTickLabelFont(font); 
     968                daxis.setLabelFont(font); 
     969                 
     970                font=new Font("Arial",0,20); 
     971                 
     972                XYPlot sp= (XYPlot) p.getSubplots().get(0); 
     973                ValueAxis raxis = sp.getRangeAxis(); 
     974                raxis.setTickLabelFont(font); 
     975                raxis.setLabelFont(font); 
     976                 
     977        NumberAxis range = (NumberAxis) sp.getRangeAxis(); 
     978                range.setTickUnit(new NumberTickUnit(100));*/ 
     979 
    944980                int nPlots = cPlot.getSubplots().size(); 
    945981 
     
    13521388                c.setBorderVisible(false); 
    13531389 
     1390                /*Font fontt=new Font("Arial",Font.BOLD,26); 
     1391                 
     1392                c.getTitle().setFont(fontt); 
     1393                Font font=new Font("Arial",0,20); 
     1394                 
     1395                CategoryPlot p = (CategoryPlot)c.getPlot(); 
     1396                CategoryAxis daxis = p.getDomainAxis(); 
     1397                daxis.setTickLabelFont(font); 
     1398                daxis.setLabelFont(font); 
     1399                 
     1400                font=new Font("Arial",0,20); 
     1401                 
     1402                ValueAxis raxis = p.getRangeAxis(); 
     1403                raxis.setTickLabelFont(font); 
     1404                raxis.setLabelFont(font); 
     1405 
     1406                font=new Font("Arial",0,20); 
     1407                c.getLegend().setItemFont(font);        */       
     1408                 
    13541409                CategoryPlot categoryplot = (CategoryPlot) c.getPlot(); 
    13551410                categoryplot.setDomainGridlinesVisible(true); 
Note: See TracChangeset for help on using the changeset viewer.