PredictorRegistry Class Reference

`#include <predictorRegistry.h>`

Inheritance diagram for PredictorRegistry:
Collaboration diagram for PredictorRegistry:

## Classes

class | Iterator
class | PredictorRegistryException

## Public Member Functions

| PredictorRegistry (Configuration *config)
| ~PredictorRegistry ()
virtual void | update (const Observable *variable)
Iterator | iterator ()
void | setContextTracker (ContextTracker *ct)
Public Member Functions inherited from Observer
virtual | ~Observer ()

## Static Public Attributes

static const char * | LOGGER = "Presage.PredictorRegistry.LOGGER"
static const char * | PREDICTORS = "Presage.PredictorRegistry.PREDICTORS"

## Private Member Functions

void | setLogger (const std::string &level)
void | setPredictors (const std::string &predictor_list)
void | addPredictor (const std::string &predictor_name)
void | removePredictor (const std::string &predictor_name)
void | removePredictors ()

## Private Attributes

Configuration * | config
ContextTracker * | contextTracker
Logger< char > | logger
std::string | predictors_list
std::vector< Predictor * > | predictors
Dispatcher< PredictorRegistry > | dispatcher

## Additional Inherited Members

Protected Member Functions inherited from Observer
| Observer ()

## Detailed Description

Manages instantiation and iteration through predictors and aids in generating predictions and learning.

PredictorRegitry class holds the active predictors and provides the interface required to obtain an iterator to the predictors.

The standard use case is: Predictor obtains an iterator from PredictorRegistry and invokes the predict() or learn() method on each Predictor pointed to by the iterator.

Predictor registry should eventually just be a simple wrapper around plump.

Definition at line 45 of file predictorRegistry.h.

## Constructor & Destructor Documentation

## PredictorRegistry()

PredictorRegistry::PredictorRegistry | ( | Configuration * | config | ) |

Definition at line 42 of file predictorRegistry.cpp.

References config, dispatcher, Configuration::find(), LOGGER, Dispatcher< class_t >::map(), PREDICTORS, setLogger(), and setPredictors().

Here is the call graph for this function:

## ~PredictorRegistry()

PredictorRegistry::~PredictorRegistry | ( |  | ) |

Definition at line 54 of file predictorRegistry.cpp.

References removePredictors().

Here is the call graph for this function:

## Member Function Documentation

## addPredictor()

void PredictorRegistry::addPredictor | ( | const std::string & | predictor_name | ) |

private

Definition at line 130 of file predictorRegistry.cpp.

References config, contextTracker, endl(), Configuration::find(), Variable::get_value(), logger, predictors, PRESAGE_INIT_PREDICTOR_ERROR, and PresageException::what().

Referenced by setPredictors().

Here is the call graph for this function:
Here is the caller graph for this function:

## iterator()

PredictorRegistry::Iterator PredictorRegistry::iterator | ( |  | ) |

Definition at line 231 of file predictorRegistry.cpp.

References predictors.

Referenced by ContextTracker::learn(), and PredictorActivator::predict().

Here is the caller graph for this function:

## removePredictor()

void PredictorRegistry::removePredictor | ( | const std::string & | predictor_name | ) |

private

Definition at line 203 of file predictorRegistry.cpp.

References endl(), logger, and predictors.

Referenced by setPredictors().

Here is the call graph for this function:
Here is the caller graph for this function:

## removePredictors()

void PredictorRegistry::removePredictors | ( |  | ) |

private

Definition at line 222 of file predictorRegistry.cpp.

References endl(), logger, and predictors.

Referenced by ~PredictorRegistry().

Here is the call graph for this function:
Here is the caller graph for this function:

## setContextTracker()

void PredictorRegistry::setContextTracker | ( | ContextTracker * | ct | ) |

Definition at line 66 of file predictorRegistry.cpp.

References contextTracker, predictors_list, and setPredictors().

Referenced by ContextTracker::ContextTracker().

Here is the call graph for this function:
Here is the caller graph for this function:

## setLogger()

void PredictorRegistry::setLogger | ( | const std::string & | level | ) |

private

Definition at line 59 of file predictorRegistry.cpp.

References endl(), logger, and setlevel().

Referenced by PredictorRegistry().

Here is the call graph for this function:
Here is the caller graph for this function:

## setPredictors()

void PredictorRegistry::setPredictors | ( | const std::string & | predictor_list | ) |

private

Definition at line 74 of file predictorRegistry.cpp.

References addPredictor(), contextTracker, endl(), logger, predictors, predictors_list, and removePredictor().

Referenced by PredictorRegistry(), and setContextTracker().

Here is the call graph for this function:
Here is the caller graph for this function:

## update()

void PredictorRegistry::update | ( | const Observable * | variable | ) |

virtual

Implements Observer.

Definition at line 261 of file predictorRegistry.cpp.

References Dispatcher< class_t >::dispatch(), dispatcher, endl(), Observable::get_name(), Observable::get_value(), and logger.

Here is the call graph for this function:

## Member Data Documentation

## config

Configuration* PredictorRegistry::config

private

Definition at line 89 of file predictorRegistry.h.

Referenced by addPredictor(), and PredictorRegistry().

## contextTracker

ContextTracker* PredictorRegistry::contextTracker

private

Definition at line 90 of file predictorRegistry.h.

Referenced by addPredictor(), setContextTracker(), and setPredictors().

## dispatcher

Dispatcher<PredictorRegistry> PredictorRegistry::dispatcher

private

Definition at line 96 of file predictorRegistry.h.

Referenced by PredictorRegistry(), and update().

## LOGGER

const char * PredictorRegistry::LOGGER = "Presage.PredictorRegistry.LOGGER"

static

Definition at line 79 of file predictorRegistry.h.

Referenced by PredictorRegistry().

## logger

Logger<char> PredictorRegistry::logger

private

Definition at line 91 of file predictorRegistry.h.

Referenced by addPredictor(), removePredictor(), removePredictors(), setLogger(), setPredictors(), and update().

## PREDICTORS

const char * PredictorRegistry::PREDICTORS = "Presage.PredictorRegistry.PREDICTORS"

static

Definition at line 80 of file predictorRegistry.h.

Referenced by PredictorRegistry().

## predictors

std::vector<Predictor*> PredictorRegistry::predictors

private

Definition at line 94 of file predictorRegistry.h.

Referenced by addPredictor(), iterator(), removePredictor(), removePredictors(), and setPredictors().

## predictors_list

std::string PredictorRegistry::predictors_list

private

Definition at line 93 of file predictorRegistry.h.

Referenced by setContextTracker(), and setPredictors().

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

- /build/presage-hvZ4Ld/presage-0.9.1/src/lib/core/predictorRegistry.h
- /build/presage-hvZ4Ld/presage-0.9.1/src/lib/core/predictorRegistry.cpp