EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports]

COVERAGE SUMMARY FOR SOURCE FILE [TimeSeriesReport.java]

nameclass, %method, %block, %line, %
TimeSeriesReport.java0%   (0/1)0%   (0/2)0%   (0/308)0%   (0/50)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TimeSeriesReport0%   (0/1)0%   (0/2)0%   (0/308)0%   (0/50)
TimeSeriesReport (): void 0%   (0/1)0%   (0/3)0%   (0/1)
prepareReportItems (Collection, RConnection): ArrayList 0%   (0/1)0%   (0/305)0%   (0/49)

1package de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports;
2 
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.Iterator;
6 
7import de.uka.ipd.sdq.sensorframework.entities.SensorAndMeasurements;
8import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.CdfReportItem;
9import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.HistogramReportItem;
10import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.IReportItem;
11import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.PdfReportItem;
12import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.RCommandRReportItem;
13import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.StaticTextReportItem;
14import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.SummaryReportItem;
15import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.TimeSeriesReportItem;
16import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.RConnection;
17import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.REngineHelper;
18 
19/**View for a set of time series.
20 * Displays a Histogram, CDF, PDF, number of measurements, mean,
21 * and the standard deviation for the series.
22 * @author groenda, martens
23 */
24public class TimeSeriesReport extends RReport {
25 
26        /** {@inheritDoc}
27         */
28        @Override
29        public ArrayList<IReportItem> prepareReportItems(
30                        final Collection<SensorAndMeasurements> c, final RConnection t) {
31                ArrayList<IReportItem> items = new ArrayList<IReportItem>();
32                items.add(new StaticTextReportItem("Time Series Report", true));
33 
34                Iterator<SensorAndMeasurements> it = c.iterator();
35                
36                HistogramReportItem hrt = new HistogramReportItem(
37                                "Histogram", "Time");
38                //hrt.setColumns(20);
39                items.add(hrt);
40                
41                CdfReportItem cdf = new CdfReportItem(
42                                "Cumulative Distribution Function", "Time");
43                items.add(cdf);
44                //cdf.setLegendPos(LegendPosition.right);
45                
46                PdfReportItem pdf = 
47                        new PdfReportItem("Probability Density Function", 
48                                "Time");
49                items.add(pdf);
50                //pdf.setLegendPos(LegendPosition.right);
51                
52                TimeSeriesReportItem timeSeries = new TimeSeriesReportItem(
53                                "Time Series", "Event Time");
54                items.add(timeSeries);
55                //pdf.setLegendPos(LegendPosition.right);
56                
57                for (int i = 0; i < c.size(); i++) {
58                        SensorAndMeasurements sm = it.next();
59                        
60                        String sensorName = REngineHelper.storeMeasurementsInRVector(sm, i, 
61                                        TimeseriesData.TIMESPAN, t);
62                        
63                        String sensorNameEventTime = REngineHelper.storeMeasurementsInRVector(sm, i, 
64                                        TimeseriesData.EVENTTIME, t);
65                        
66                        items.add(new SummaryReportItem(sensorName, 
67                                sm.getSensor().getSensorName()));
68                        hrt.addData("s" + i, sm.getSensor().getSensorName(), sensorName);
69                        cdf.addData("s" + i, sm.getSensor().getSensorName(), sensorName);
70                        pdf.addData("s" + i, sm.getSensor().getSensorName(), sensorName);
71                        
72                        timeSeries.addData("s" + i, sm.getSensor().getSensorName(), sensorName);
73                        timeSeries.addData("s_ET_" + i, sm.getSensor().getSensorName()+"_ET", sensorNameEventTime);
74                        
75                        String rCommand = "length(" + sensorName + ")\n";
76                        items.add(new RCommandRReportItem(rCommand, 
77                                "Number of observations of Sensor " 
78                                        + sm.getSensor().getSensorName()));
79                        
80                        rCommand = "mean(" + sensorName + ")\n";
81                        items.add(new RCommandRReportItem(rCommand, 
82                                "Mean of Sensor " + sm.getSensor().getSensorName()));
83                        
84                        rCommand = "sd(" + sensorName + ")\n";
85                        items.add(new RCommandRReportItem(rCommand, 
86                                        "Standard-Deviation of Sensor " 
87                                        + sm.getSensor().getSensorName()));
88                        
89                        rCommand = "max(" + sensorNameEventTime +") - min(" + sensorNameEventTime +")\n";
90                        items.add(new RCommandRReportItem(rCommand, 
91                                        "Experiment duration (max(EventTimes) - min(EventTimes)) of Sensor " 
92                                        + sm.getSensor().getSensorName()));
93                        
94                        rCommand = "length(" + sensorNameEventTime + ") / (max(" + sensorNameEventTime +") - min(" + sensorNameEventTime +"))\n";
95                        items.add(new RCommandRReportItem(rCommand, 
96                                        "Throughput of Sensor " 
97                                        + sm.getSensor().getSensorName()));
98                        
99                        
100                }
101                
102                return items;
103        }
104 
105}

[all classes][de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov