presage  0.8.7
Public Member Functions | Protected Attributes
Predictor Class Reference

#include <predictor.h>

Inheritance diagram for Predictor:
Inheritance graph
[legend]
Collaboration diagram for Predictor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Predictor (Configuration *configuration, ContextTracker *contextTracker, const char *predictorName="Predictor", const char *shortDescription="", const char *longDescription="")
virtual ~Predictor ()
virtual Prediction predict (const size_t size, const char **filter) const =0
 Generate prediction.
virtual void learn (const std::vector< std::string > &change)=0
const std::string getName () const
const std::string getShortDescription () const
const std::string getLongDescription () const
virtual void set_logger (const std::string &level)

Protected Attributes

const std::string name
const std::string shortDescription
const std::string longDescription
ContextTrackercontextTracker
Configurationconfiguration
Logger< char > logger

Detailed Description

Predictor is an abstract class that defines the interface implemented by concrete predictors.

The prediction algorithm implemented by predictors is at the heart of presage. The predictor-based architecture allows new prediction methods to be easily and transparently added to the system.

Predictors have access to and rely on the services provided by core components of the presage system.

Definition at line 49 of file predictor.h.


Constructor & Destructor Documentation

Predictor::Predictor ( Configuration config,
ContextTracker ct,
const char *  predictorName = "Predictor",
const char *  shortDesc = "",
const char *  longDesc = "" 
)

Creates a predictor object.

Parameters:
configpointer to configuration
ctis a reference to HistoryTracker
predictorNameis the predictor name
shortDescis a short description of the predictor's functionality
longDescis a long description of the predictor's functionality

Definition at line 39 of file predictor.cpp.

Predictor::~Predictor ( ) [virtual]

Virtual predictor destructor.

Definition at line 59 of file predictor.cpp.


Member Function Documentation

const std::string Predictor::getLongDescription ( ) const

Get predictor long description.

Definition at line 81 of file predictor.cpp.

References longDescription.

const std::string Predictor::getName ( ) const

Get predictor name.

Definition at line 65 of file predictor.cpp.

References name.

Referenced by PredictorActivator::predict().

Here is the caller graph for this function:

const std::string Predictor::getShortDescription ( ) const

Get predictor short description.

Definition at line 73 of file predictor.cpp.

References shortDescription.

virtual void Predictor::learn ( const std::vector< std::string > &  change) [pure virtual]
virtual Prediction Predictor::predict ( const size_t  size,
const char **  filter 
) const [pure virtual]

Generate prediction.

Parameters:
sizedesired prediction size
filterfilter

Implemented in ARPAPredictor, RecencyPredictor, SmoothedNgramPredictor, AbbreviationExpansionPredictor, DejavuPredictor, DictionaryPredictor, and DummyPredictor.

Referenced by PredictorActivator::predict().

Here is the caller graph for this function:

void Predictor::set_logger ( const std::string &  level) [virtual]

Member Data Documentation

Definition at line 83 of file predictor.h.

Logger<char> Predictor::logger [protected]
const std::string Predictor::longDescription [protected]

Definition at line 79 of file predictor.h.

Referenced by getLongDescription().

const std::string Predictor::name [protected]

Definition at line 77 of file predictor.h.

Referenced by getName().

const std::string Predictor::shortDescription [protected]

Definition at line 78 of file predictor.h.

Referenced by getShortDescription().


The documentation for this class was generated from the following files: