Class OnlineLOF.LOFKNNListener

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

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

      • firstEventReceived

        private 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​(KNNChangeEvent e)
        Description copied from interface: KNNListener
        Invoked after kNNs have been updated, inserted or removed in some way.
        Specified by:
        kNNsChanged in interface KNNListener
        Parameters:
        e - the change event
      • kNNsChanged

        private void kNNsChanged​(KNNChangeEvent e1,
                                 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​(DBIDs insertions,
                                  DBIDs updates1,
                                  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​(DBIDs deletions,
                                 DBIDs updates1,
                                 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​(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