ibspan.tss.agents.pma.learning
Class ContinuousLearning

java.lang.Object
  extended by jade.core.behaviours.Behaviour
      extended by jade.core.behaviours.CompositeBehaviour
          extended by jade.core.behaviours.SerialBehaviour
              extended by jade.core.behaviours.FSMBehaviour
                  extended by ibspan.tss.agents.pma.learning.ContinuousLearning
All Implemented Interfaces:
Serializable

public class ContinuousLearning
extends FSMBehaviour

This behaviour runs cyclicly realizing process of learning of user profiles. It works in cycles containing the following steps:

  1. Preparing LearningTask object.
    1. Collecting subscribed packs of events. This step is repeated until new packs (one or more) of events appear in SynchronizedStore object, passsed as an argument in constructor.
    2. Preprocessing new events by EventsPreprocessor object. All new events are preprocessed to find which users played in them and which concepts were objected in them. RestaurantServiceAgent is requested to provide detailed information about clicked or rated concepts (i.e. descriptions of restaurants). All prepared information are used to construct new LearningTask object. The implementation of this substep has been partially parallelized.
  2. Learning user profiles with use of LearningAlgorithm instance. In this step prepared LearningTask object is used as a base for learning process. No temporary copy of profiles model is created for the time of work of this step. Learning process works on profiles in transaction mode, which gives warranty that all changes made to a model within a transaction, will either be made, or none of them will be made. Additionally other behaviours see status quo of profiles before starting a transaction and there is no problem with reading them.

This behaviour should be launched in a seperate thread to avoid blocking of whole agent.

Author:
Maciej Gawinecki
See Also:
SynchronizedStore, HistorySubscriber, LearningTask, LearningAlgorithm, EventsPreprocessor, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
 
Field Summary
 
Fields inherited from class jade.core.behaviours.FSMBehaviour
currentName, lastStates, previousName
 
Fields inherited from class jade.core.behaviours.CompositeBehaviour
currentExecuted
 
Fields inherited from class jade.core.behaviours.Behaviour
myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
 
Constructor Summary
ContinuousLearning(Agent a, SynchronizedStore store)
          Constructs ContinuousLearning behaviour.
 
Method Summary
 
Methods inherited from class jade.core.behaviours.FSMBehaviour
checkTermination, deregisterState, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, reset, resetStates, scheduleFirst, scheduleNext
 
Methods inherited from class jade.core.behaviours.SerialBehaviour
handle
 
Methods inherited from class jade.core.behaviours.CompositeBehaviour
action, block, done, registerAsChild, resetChildren, restart, setAgent
 
Methods inherited from class jade.core.behaviours.Behaviour
actionWrapper, block, getBehaviourName, getDataStore, getExecutionState, getParent, isRunnable, onStart, root, setBehaviourName, setDataStore, setExecutionState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinuousLearning

public ContinuousLearning(Agent a,
                          SynchronizedStore store)
Constructs ContinuousLearning behaviour.

Parameters:
a - is the agent this behaviour belongs to.
store - is a store where new packs of events can be found.