forked from hxim/paq8px
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIPredictor.hpp
24 lines (21 loc) · 885 Bytes
/
IPredictor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef PAQ8PX_IPREDICTOR_HPP
#define PAQ8PX_IPREDICTOR_HPP
/**
* Common interface for all probability predictors (probability map and mixer classes).
* It declares the update() event handler.
* A probability predictor predicts the probability that the next bit is 1.
* After each bit becomes known, all probability predictors participated
* in the prediction must update their internal state to improve future
* predictions (adapting). In order to achieve this, a probability
* predictor must
* 1) inherit from the IPredictor interface,
* 2) implement the update() interface method,
* 3) subscribe for the broadcast in p() or mix(),
* 4) receive the update event from UpdateBroadcaster and update its internal state in update().
*/
class IPredictor {
public:
virtual void update() = 0;
virtual ~IPredictor() = default;
};
#endif //PAQ8PX_IPREDICTOR_HPP