Class OnlineLOF.LOFKNNListener

  • All Implemented Interfaces:
    elki.index.preprocessed.knn.KNNListener, java.util.EventListener
    Enclosing class:
    OnlineLOF<O>

    private class OnlineLOF.LOFKNNListener
    extends java.lang.Object
    implements elki.index.preprocessed.knn.KNNListener
    Encapsulates a listener for changes of kNNs used in the online LOF algorithm.
    Author:
    Elke Achtert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private elki.index.preprocessed.knn.KNNChangeEvent firstEventReceived
      Holds the first event of one of the both preprocessors.
      private FlexibleLOF.LOFResult<O> lofResult
      Holds the result of a former run of the LOF algorithm.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void kNNsChanged​(elki.index.preprocessed.knn.KNNChangeEvent e)  
      private void kNNsChanged​(elki.index.preprocessed.knn.KNNChangeEvent e1, elki.index.preprocessed.knn.KNNChangeEvent e2)
      Invoked after the events of both preprocessors have been received, i.e.
      private void kNNsInserted​(elki.database.ids.DBIDs insertions, elki.database.ids.DBIDs updates1, elki.database.ids.DBIDs updates2, FlexibleLOF.LOFResult<O> lofResult)
      Invoked after kNNs have been inserted and updated, updates the result.
      private void kNNsRemoved​(elki.database.ids.DBIDs deletions, elki.database.ids.DBIDs updates1, elki.database.ids.DBIDs updates2, FlexibleLOF.LOFResult<O> lofResult)
      Invoked after kNNs have been removed and updated, updates the result.
      private void recomputeLOFs​(elki.database.ids.DBIDs ids, FlexibleLOF.LOFResult<O> lofResult)
      Recomputes the lofs of the specified ids.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • firstEventReceived

        private elki.index.preprocessed.knn.KNNChangeEvent firstEventReceived
        Holds the first event of one of the both preprocessors. The online algorithm is waiting until both events have been received, i.e. until both preprocessors are up to date.
      • lofResult

        private FlexibleLOF.LOFResult<O> lofResult
        Holds the result of a former run of the LOF algorithm.
    • Constructor Detail

      • LOFKNNListener

        public LOFKNNListener​(FlexibleLOF.LOFResult<O> lofResult)
        Constructs a listener for the LOF algorithm.
        Parameters:
        lofResult - the result of a former run of the LOF algorithm
    • Method Detail

      • kNNsChanged

        public void kNNsChanged​(elki.index.preprocessed.knn.KNNChangeEvent e)
        Specified by:
        kNNsChanged in interface elki.index.preprocessed.knn.KNNListener
      • kNNsChanged

        private void kNNsChanged​(elki.index.preprocessed.knn.KNNChangeEvent e1,
                                 elki.index.preprocessed.knn.KNNChangeEvent e2)
        Invoked after the events of both preprocessors have been received, i.e. until both preprocessors are up to date.
        Parameters:
        e1 - the change event of the first preprocessor
        e2 - the change event of the second preprocessor
      • kNNsInserted

        private void kNNsInserted​(elki.database.ids.DBIDs insertions,
                                  elki.database.ids.DBIDs updates1,
                                  elki.database.ids.DBIDs updates2,
                                  FlexibleLOF.LOFResult<O> lofResult)
        Invoked after kNNs have been inserted and updated, updates the result.
        Parameters:
        insertions - the ids of the newly inserted neighborhoods
        updates1 - the ids of the updated neighborhood w.r.t. the neighborhood distance function
        updates2 - the ids of the updated neighborhood w.r.t. the reachability distance function
        lofResult - the result of the former LOF run
      • kNNsRemoved

        private void kNNsRemoved​(elki.database.ids.DBIDs deletions,
                                 elki.database.ids.DBIDs updates1,
                                 elki.database.ids.DBIDs updates2,
                                 FlexibleLOF.LOFResult<O> lofResult)
        Invoked after kNNs have been removed and updated, updates the result.
        Parameters:
        deletions - the ids of the removed neighborhoods
        updates1 - the ids of the updated neighborhood w.r.t. the neighborhood distance function
        updates2 - the ids of the updated neighborhood w.r.t. the reachability distance function
        lofResult - the result of the former LOF run
      • recomputeLOFs

        private void recomputeLOFs​(elki.database.ids.DBIDs ids,
                                   FlexibleLOF.LOFResult<O> lofResult)
        Recomputes the lofs of the specified ids.
        Parameters:
        ids - the ids of the lofs to be recomputed
        lofResult - the result of the former LOF run