37 predictorRegistry(registry),
39 logger(
"PredictorActivator", std::cerr),
78 predictor = it.
next();
106 logger << ERROR <<
"Error: attempted to set PREDICT_TIME option to "
107 <<
"a negative integer value. Please make sure that "
108 <<
"PREDICT_TIME option is set to a value greater "
109 <<
"than or equal to zero.\a" <<
endl;
111 logger << INFO <<
"PREDICT_TIME: " << result <<
endl;
125 logger << INFO <<
"Setting COMBINATION_POLICY to " << cp <<
endl;
130 if (policy ==
"meritocracy") {
134 logger << ERROR <<
"Error - unknown combination policy: "
163 if ((command.size() == 7)
164 && command[4] ==
'a' && command[0] ==
'p' && command[6] ==
'e'
166 && command[3] ==
's' && command[1] ==
'r' && command[2] ==
'e'
169 if (subcommand.size() == 7
170 && subcommand[2] ==
'r' && subcommand[4] ==
'i' && subcommand[6] ==
'n'
171 && subcommand[0] ==
'v' && subcommand[1] ==
'e' && subcommand[3] ==
's'
172 && subcommand[5] ==
'o'
174 #ifndef PACKAGE_STRING
175 #define PACKAGE_STRING pr3s4g3
180 if (subcommand.size() == 6
181 && subcommand[4] ==
'n' && subcommand[0] ==
'e' && subcommand[1] ==
'n'
182 && subcommand[5] ==
'e' && subcommand[2] ==
'g' && subcommand[3] ==
'i'
virtual Prediction combine(const std::vector< Prediction > &)=0
Variable * find(const std::string &variable) const
Tracks user interaction and context.
std::string getToken(const int) const
void dispatch(const Observable *var)
void map(Observable *var, const mbr_func_ptr_t &ptr)
virtual std::string get_name() const =0
virtual std::string get_value() const =0
void addSuggestion(Suggestion)
void setMaxPartialPredictionSize(const std::string &size)
void parse_internal_commands(Prediction &pred)
void setPredictTime(const std::string &predictTime)
std::string getCombinationPolicy() const
int getPredictTime() const
PredictorActivator(Configuration *config, PredictorRegistry *registry, ContextTracker *contextTracker)
ContextTracker * contextTracker
std::string combinationPolicy
static const char * MAX_PARTIAL_PREDICTION_SIZE
void setCombinationPolicy(const std::string &policy)
Dispatcher< PredictorActivator > dispatcher
static const char * LOGGER
virtual void update(const Observable *variable)
static const char * PREDICT_TIME
PredictorRegistry * predictorRegistry
void setLogger(const std::string &level)
int max_partial_prediction_size
std::vector< Prediction > predictions
Prediction predict(unsigned int multiplier, const char **filter)
static const char * COMBINATION_POLICY
const std::string getName() const
virtual Prediction predict(const size_t size, const char **filter) const =0
Generate prediction.
static char * strtolower(char *)
static int toInt(const std::string)
_SetLevel setlevel(std::string __l)
Manipulator for level.
const Logger< _charT, _Traits > & endl(const Logger< _charT, _Traits > &lgr)