Column-oriented GPU-accelerated Database Management System
CoGaDB
hype::core::Algorithm Class Reference

This class represents an algorithm. It abstracts important features and encapsulates information of the algorithm. At the same time, it is highly adaptable. More...

#include <algorithm.hpp>

Collaboration diagram for hype::core::Algorithm:

List of all members.

Public Member Functions

 Algorithm (const std::string &name_of_algorithm, const std::string &name_of_statistical_method, const std::string &name_of_recomputation_strategy, Operation &operation, DeviceSpecification comp_dev)
 Initializes Algorithm according to Parameters name_of_algorithm, name_of_statistical_method, name_of_recomputation_strategy.
 ~Algorithm ()
 Destroys the Algorithm and writes the statistics to disc file.
bool setStatisticalMethod (std::tr1::shared_ptr< StatisticalMethod_Internal > ptr_statistical_method)
bool setRecomputationHeuristic (std::tr1::shared_ptr< RecomputationHeuristic_Internal > ptr_recomp_heuristic)
const std::string getName () const
const EstimatedTime getEstimatedExecutionTime (const Tuple &input_values)
unsigned int getNumberOfDecisionsforThisAlgorithm () const throw ()
unsigned int getNumberOfTerminatedExecutions () const throw ()
double getTotalExecutionTime () const throw ()
 returns the total time this algorithm spend in execution
bool addMeasurementPair (const MeasurementPair &mp)
AlgorithmStatisticsgetAlgorithmStatistics ()
bool inTrainingPhase () const throw ()
bool inRetrainingPhase () const throw ()
uint64_t getTimeOfLastExecution () const throw ()
void setTimeOfLastExecution (uint64_t new_timestamp) throw ()
void incrementNumberofDecisionsforThisAlgorithm () throw ()
void retrain ()
const LoadChangeEstimatorgetLoadChangeEstimator () const throw ()
const DeviceSpecification getDeviceSpecification () const throw ()

Private Attributes

std::string name_
std::tr1::shared_ptr
< StatisticalMethod_Internal
ptr_statistical_method_
std::tr1::shared_ptr
< RecomputationHeuristic_Internal
ptr_recomputation_heristic_
AlgorithmStatistics statistics_
Operationoperation_
uint64_t logical_timestamp_of_last_execution_
bool is_in_retraining_phase_
unsigned int retraining_length_
LoadChangeEstimator load_change_estimator_
DeviceSpecification comp_dev_

Detailed Description

This class represents an algorithm. It abstracts important features and encapsulates information of the algorithm. At the same time, it is highly adaptable.

An algorithm gets assigned three things. First is a statistical method, which dictates an approximation function and takes care of recomputing the approximation function. Second is a recomputation heuristic, which decides, when to recompute an algorithm. Third is a statistic, which stores past observed execution tiems ofthe algorithm together with an abstraction of the input data set in a measurement pair list. This list is implemented by the class stemod::core::AlgorithmStatistics. The algorithm has to update it's statistics every time, a new observation (an instance of class stemod::core::MeasurementPair) is added. Hence, the Algorithm class provides the basis for the decision component, which is done by an optimization_criterion, which is implemented by drived classes of stemod::core::OptimizationCriterion.

Note that the statistical method and the recomputation statistic can be exchanged at run-time, because the Algortihm uses the pointer to implementation technique (or pimpl-idiom).

Author:
Sebastian Breß
Version:
0.1
Date:
2012

Constructor & Destructor Documentation

hype::core::Algorithm::Algorithm ( const std::string &  name_of_algorithm,
const std::string &  name_of_statistical_method,
const std::string &  name_of_recomputation_strategy,
Operation operation,
DeviceSpecification  comp_dev 
)

Initializes Algorithm according to Parameters name_of_algorithm, name_of_statistical_method, name_of_recomputation_strategy.

Parameters:
name_of_algorithmname of the algorithm, it has to be unique!
name_of_statistical_methodthe name of a supported statistical method
name_of_recomputation_strategyname of the recomputation strategy

Destroys the Algorithm and writes the statistics to disc file.


Member Function Documentation

const std::string hype::core::Algorithm::getName ( ) const
uint64_t hype::core::Algorithm::getTimeOfLastExecution ( ) const throw ()

returns the total time this algorithm spend in execution

Returns:
bool hype::core::Algorithm::inTrainingPhase ( ) const throw ()
Returns:
bool hype::core::Algorithm::setRecomputationHeuristic ( std::tr1::shared_ptr< RecomputationHeuristic_Internal ptr_recomp_heuristic)
bool hype::core::Algorithm::setStatisticalMethod ( std::tr1::shared_ptr< StatisticalMethod_Internal ptr_statistical_method)
void hype::core::Algorithm::setTimeOfLastExecution ( uint64_t  new_timestamp) throw ()

Member Data Documentation

std::string hype::core::Algorithm::name_ [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines