ibspan.tss.um.learning
Class StatisticsBuffer

java.lang.Object
  extended by ibspan.tss.um.learning.StatisticsBuffer

public class StatisticsBuffer
extends Object

This class holds information about number of events in which particular user (or all users) performed particular UserBehaviour object (or all possible UserBehaviour objects) objected against particular concept (or all possible concepts).

This class must be initialized:

  1. by model of statistics used to store statistics in database and passed as an argument of contructor and
  2. by calling at least one time method updateStatistics(List) to load statistics about given events into the buffer.

The aim and the way this class has been implemented results from requirement for short-time access to statistics during learning process. Therefore, most of necessary statistics are stored locally.

Author:
Maciej Gawinecki

Constructor Summary
StatisticsBuffer(OntModel mStatisticsDB)
          Constructs StatisticsBuffer with the given model of statistics underlying.
 
Method Summary
 Integer getStatistic(Integer userID, UserBehaviour ub, String conceptURI)
          Returns the number of events matching the given key values.
 void updateStatistics(List<ExtendedEvent> events)
          Updates statistics in this buffer and underlying database model by processing the given events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsBuffer

public StatisticsBuffer(OntModel mStatisticsDB)
Constructs StatisticsBuffer with the given model of statistics underlying.

Parameters:
mStatisticsDB - model with statistics
Method Detail

updateStatistics

public void updateStatistics(List<ExtendedEvent> events)
Updates statistics in this buffer and underlying database model by processing the given events.

Parameters:
events - events from which statistics will be calculated.

getStatistic

public Integer getStatistic(Integer userID,
                            UserBehaviour ub,
                            String conceptURI)
Returns the number of events matching the given key values.

Parameters:
userID - is id of a user acting in an event; if null value then number of events for all users will be returned.
userBehaviour - is user behaviour performed in an event; if null then number of events for all possible user behaviours will be returned.
conceptURI - is URI reference of concept objected by an event; if null then number of events for all possible concepts will be returned.
Returns:
number of matching events