C# Class Metrics.QualityCalculator

This static class contains methods to calculate various component of the Quality Coefficient
显示文件 Open project: zencoders/sambatyon

Public Methods

Method Description
calculateFileQuality ( String filepath ) : QualityCoefficient

Calculates only the File Quality component of the Quality Coefficient

calculatePeerQuality ( int buffered, int queueSize ) : QualityCoefficient

Calculates only the Peer Quality component of the Quality Coefficient

calculateQualityCoefficient ( String searchString, String tags, int buffered, int queueSize, String filepath ) : QualityCoefficient

Calculates all components of the Quality Coefficient. This method extact file quality information directly from the file itself.

calculateQualityCoefficient ( String searchString, String tags, int buffered, int queueSize, int bitrate, int channelmode, int samplerate ) : QualityCoefficient

Calculates all components of the Quality Coefficient. This method needs file quality information to be passed as arguments.

calculateSearchAffinity ( String searchString, String tags ) : QualityCoefficient

Calculates only the Search Affinity Component of the Quality Coefficient.

Private Methods

Method Description
calculateAFF ( String searchString, String tags ) : double

Calculates the affinity coefficient of a tag sets with a given search string. For implementation details read the Wiki Page for this coefficient (http://code.google.com/p/p2p-player/wiki/ImplicitQoS#Coefficiente_di_Affinità)

calculateFQ ( String filepath ) : FileQualityCoefficient

Calculates the File Quality Coefficient extracting information from the MPEG file Header. For implementation details read the Wiki Page for this coefficient (http://code.google.com/p/p2p-player/wiki/ImplicitQoS#Coefficiente_di_Qualità_del_File)

calculateFQ ( int bitrate, int channelmode, int samplerate ) : FileQualityCoefficient

Returns an object of type FileQualityCoefficient with the given components

calculatePQ ( int buffered, int queueSize ) : double

Calculates Peer Quality Coefficient

Method Details

calculateFileQuality() public static method

Calculates only the File Quality component of the Quality Coefficient
public static calculateFileQuality ( String filepath ) : QualityCoefficient
filepath String Path of the file to analyze
return QualityCoefficient

calculatePeerQuality() public static method

Calculates only the Peer Quality component of the Quality Coefficient
public static calculatePeerQuality ( int buffered, int queueSize ) : QualityCoefficient
buffered int Number of buffered chunks
queueSize int Size of the chunk queue
return QualityCoefficient

calculateQualityCoefficient() public static method

Calculates all components of the Quality Coefficient. This method extact file quality information directly from the file itself.
public static calculateQualityCoefficient ( String searchString, String tags, int buffered, int queueSize, String filepath ) : QualityCoefficient
searchString String Searched String
tags String List of tags returned by the research action
buffered int Number of buffered chunks
queueSize int Size of the chunk queue
filepath String Path of the file to analyze
return QualityCoefficient

calculateQualityCoefficient() public static method

Calculates all components of the Quality Coefficient. This method needs file quality information to be passed as arguments.
public static calculateQualityCoefficient ( String searchString, String tags, int buffered, int queueSize, int bitrate, int channelmode, int samplerate ) : QualityCoefficient
searchString String Searched String
tags String List of tags returned by the research action
buffered int Number of buffered chunks
queueSize int Size of the chunk queue
bitrate int Bit rate component
channelmode int Channel mode component
samplerate int Sample rate component
return QualityCoefficient

calculateSearchAffinity() public static method

Calculates only the Search Affinity Component of the Quality Coefficient.
public static calculateSearchAffinity ( String searchString, String tags ) : QualityCoefficient
searchString String Searched String
tags String List of tags returned by the research action
return QualityCoefficient