at.tuwien.ifs.somtoolbox.reportgenerator.output
Class OutputReportHtml

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.reportgenerator.output.OutputReportHtml
All Implemented Interfaces:
OutputReport

public class OutputReportHtml
extends Object
implements OutputReport

This class generates the Report as HTML output. It holds a reference to an instance of ReportFileWriter, to which all Strings that shall appear in the output are send. This class does only handle how this strings schall look like, and not with any technical detail about how these strings are actually written to a file or elsewhere.

Version:
$Id: OutputReportHtml.java 3883 2010-11-02 17:13:23Z frank $
Author:
Sebastian Skritek (0226286, Sebastian.Skritek@gmx.at), Martin Waitzbauer (0226025), Rudolf Mayer

Field Summary
private  DatasetInformation datasetInformation
           
private  EditableReportProperties EP
           
private  String imagePath
           
private  String outputDirPath
           
private  TestRunResultCollection testruns
           
private  int type
           
private  ReportFileWriter writer
          handles the actual writing of the output.
 
Constructor Summary
OutputReportHtml(String outputDir, EditableReportProperties EP)
          Creates a new Object to finally print the report in HTML
 
Method Summary
protected  String classNumberString()
          returns the information (or missing information) about classes nicely formatted
 void createOutput()
          creates the report about as HTML file.
private  void createScriptAndStyleFiles()
          Creates the "reporter.js" and "reporter.css" files, from the templates in rsc/reportGenerator/
private  String getSOMDimensions(TestRunResult testrun)
          returns the dimension of the SOM nicley formatted.
private  void printComparingReport()
          creates the sections that compares the results of the different specified trainings this comparison constists of a table containing some basic properties of the SOMs, the visualizations of the class distribution, the distribution of the input items and the U-Matrices of the SOM.
private  void printDatasetReport()
          outputs the section concerning the dataset Information included in this section are: number of inputs dimension of inputs information about the data distribution within the different dimensions ... Also, if class information are provided, these are printed.
private  void printReportEnd()
          prints the foot of the report this includes any fixed data to be displayed at the end, as well as all markup required to finish and close the report
private  void printReportOnTestrun(int r, boolean moreRuns)
          prints the results of/information about one som training and its results.
private  void printReportStart()
          prints the start of the report.
private  void printTestrunsReport()
          first outputs the section containing the results from the different testruns specified, then a short comparison of the testruns (SOM configuration and basic results) is printed.
 void setDatasetInformation(DatasetInformation infoObj)
          gives an Object to the report writer that stores all information about the used dataset.
 void setTestrunInformation(TestRunResultCollection testruns, int type)
          gives an Object to the report writer that stores all information about the performed that shall be documented within the report.
private  void writeHeader(String header)
           
private  void writeSubHeader(String header)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

private ReportFileWriter writer
handles the actual writing of the output. All Strings that shall appear in the output are handed over to it


datasetInformation

private DatasetInformation datasetInformation

testruns

private TestRunResultCollection testruns

outputDirPath

private String outputDirPath

imagePath

private String imagePath

type

private int type

EP

private EditableReportProperties EP
Constructor Detail

OutputReportHtml

public OutputReportHtml(String outputDir,
                        EditableReportProperties EP)
Creates a new Object to finally print the report in HTML

Parameters:
outputDir - the path to the directory where the files shall be saved to
Method Detail

setDatasetInformation

public void setDatasetInformation(DatasetInformation infoObj)
gives an Object to the report writer that stores all information about the used dataset. Should be specified before the createOutput function is called, otherwise no information about the dataset can be reported

Specified by:
setDatasetInformation in interface OutputReport
Parameters:
infoObj - object containing all available information about the used dataset

setTestrunInformation

public void setTestrunInformation(TestRunResultCollection testruns,
                                  int type)
gives an Object to the report writer that stores all information about the performed that shall be documented within the report. Should be specified before the createOutput function is called, otherwise no information about the testruns can be reported

Specified by:
setTestrunInformation in interface OutputReport
Parameters:
testruns - object containting all available information about the testruns performed

createOutput

public void createOutput()
creates the report about as HTML file. All necessary setXXX functions should be called before this function is called and the output starts.

Specified by:
createOutput in interface OutputReport

printReportStart

private void printReportStart()
prints the start of the report. includes the page start, title, and references to JS and CSS files. The contents are read from rsc/reportGenerator/pageStart.html


printReportEnd

private void printReportEnd()
prints the foot of the report this includes any fixed data to be displayed at the end, as well as all markup required to finish and close the report


printDatasetReport

private void printDatasetReport()
outputs the section concerning the dataset Information included in this section are: Also, if class information are provided, these are printed. This includes: the number of classes, the number of inputs within each class, ...


writeSubHeader

private void writeSubHeader(String header)

writeHeader

private void writeHeader(String header)

printTestrunsReport

private void printTestrunsReport()
first outputs the section containing the results from the different testruns specified, then a short comparison of the testruns (SOM configuration and basic results) is printed. for the output of the sections for the different training runs, this.printReportOnTestrun(run) is used


printReportOnTestrun

private void printReportOnTestrun(int r,
                                  boolean moreRuns)
prints the results of/information about one som training and its results. What infromation is actual written to the report depends on the type of som that has been trained, as all kind of SOMs may need different information to be given. In general, first, a list of parameters for the training process and some basic properties of the som are outputted. Then, if a class file has been selected, a table visualizing the class distribution is given. If input vectors has been selected for retrieving information about where they are located, another table storing these information is printed. After some quantization errors, information about the clusters found are written.

Parameters:
r - the index of the testrun (start counting by 0)
moreRuns - true if the results of more than one training has been spcified, false otherwise

printComparingReport

private void printComparingReport()
creates the sections that compares the results of the different specified trainings this comparison constists of a table containing some basic properties of the SOMs, the visualizations of the class distribution, the distribution of the input items and the U-Matrices of the SOM.


getSOMDimensions

private String getSOMDimensions(TestRunResult testrun)
returns the dimension of the SOM nicley formatted. returned as string x-size x y- size

Parameters:
testrun - the testrun for which the dimensions are needed
Returns:
unknown or "x-size x y-size" (in units)

classNumberString

protected String classNumberString()
returns the information (or missing information) about classes nicely formatted

Returns:
the number of classes or information that this information is missing

createScriptAndStyleFiles

private void createScriptAndStyleFiles()
Creates the "reporter.js" and "reporter.css" files, from the templates in rsc/reportGenerator/