Interface Iteration<U,​I,​P>

Type Parameters:
U - Type of the users.
I - Type of the information pieces.
P - Type of the parameters.
All Known Implementing Classes:
SimpleIteration

public interface Iteration<U,​I,​P>
Class that represents a single iteration.
  • Method Summary

    Modifier and Type Method Description
    boolean addDiscardingUser​(U u, java.util.List<I> discardedPieces)
    Adds the discarded pieces of a single user to the iteration
    boolean addPropagatingUser​(U u, java.util.List<I> propagatedPieces)
    Adds the propagated pieces of a single user to the iteration
    boolean addReceivingUser​(U u, java.util.Map<I,​java.util.Set<U>> seenPieces)
    Adds the received pieces of a single user to the iteration.
    boolean addReReceivingUser​(U u, java.util.Map<I,​java.util.Set<U>> rereceivedPieces)
    Adds the re-received pieces of a single user discarded pieces to the iteration
    java.util.stream.Stream<I> getDiscardedInformation​(U u)
    Obtains the set of information pieces that a given user has discarded during this iteration.
    java.util.stream.Stream<U> getDiscardingUsers()
    Obtains the set of users which have discarded, at least, one information piece during this iteration.
    int getIterationNumber()
    Obtains the iteration number.
    int getNumDiscarded()
    Obtains the total number of discarded information pieces.
    int getNumDiscarded​(U u)
    Obtains the total number of information pieces that a given user has discarded during this iteration.
    int getNumDiscardingUsers()
    Obtains the total number of users which have discarded information pieces.
    int getNumPropagated()
    Obtains the total number of propagated information pieces (it does not take into account how many people received them).
    int getNumPropagated​(U u)
    Obtains the total number of information pieces that a given user has propagated during this iteration.
    int getNumPropagatingUsers()
    Obtains the total number of users which have propagated information pieces.
    int getNumReceivingUsers()
    Obtains the number of users which have received and read new information in this iteration.
    int getNumReReceived()
    Obtains the total number of information pieces which have been read by the different users in the network after they had read them in previous iterations.
    int getNumReReceived​(U u)
    Obtains the total number of information pieces which have been seen by a user (considering that the user had read them before).
    int getNumReReceivingUsers()
    Obtains the number of users which have received and read information pieces they had read before.
    int getNumSeen()
    Obtains the total of number of information pieces which have been read by the different users in the network for the first time during this iteration.
    int getNumSeen​(U u)
    Obtains the total number of information pieces which have been read by a user in the network for the first time during this iteration.
    int getNumUniqueReReceived()
    Obtains the number of information pieces which have been read by a user in the network (without taking into acount how many times it has been received during this iteration), considering that the user had read them before.
    int getNumUniqueReReceived​(U u)
    Obtains the total number of different information pieces which have been read by a user in the network during this iteration after they were read in a previous iteration.
    int getNumUniqueSeen()
    Obtains the number of information pieces which have been read by a user in the network (without taking into acount how many times it has been received during this iteration).
    int getNumUniqueSeen​(U u)
    Obtains the total number of different information pieces which have been read by a user in the network for the first time during this iteration.
    java.util.stream.Stream<I> getPropagatedInformation​(U u)
    Obtains the set of information pieces that a given user has propagated during this iteration.
    java.util.stream.Stream<U> getPropagatingUsers()
    Obtains the set of users which have propagated, at least, one information piece during this iteration.
    java.util.stream.Stream<U> getReceivingUsers()
    Obtains the set of users which have received and read, at least, one piece of information which they had not read before.
    java.util.stream.Stream<Tuple2oo<I,​java.util.Set<U>>> getReReceivedInformation​(U u)
    Obtains the set of information that a given user read in previous iterations, and have been re-read in this one.
    java.util.stream.Stream<U> getReReceivingUsers()
    Obtains the set of users which have received and read, at least, one piece of information they had read before.
    java.util.stream.Stream<Tuple2oo<I,​java.util.Set<U>>> getSeenInformation​(U u)
    Obtains the set of information pieces that a given user has read for the first time during this iteration.
    default int getTotalReceived()
    Obtains the total number of read information pieces during this iteration.
    default int getTotalReceived​(U u)
    Obtains the total number of information pieces that a given user has read during this iteration.
  • Method Details

    • addReceivingUser

      boolean addReceivingUser​(U u, java.util.Map<I,​java.util.Set<U>> seenPieces)
      Adds the received pieces of a single user to the iteration.
      Parameters:
      u - the user identifier.
      seenPieces - the list of pieces that this user has newly seen this iteration (and their authors).
      Returns:
      true if everything is OK, false if it is not.
    • addReReceivingUser

      boolean addReReceivingUser​(U u, java.util.Map<I,​java.util.Set<U>> rereceivedPieces)
      Adds the re-received pieces of a single user discarded pieces to the iteration
      Parameters:
      u - the user identifier.
      rereceivedPieces - the list of pieces that this user has re-received this iteration (and their authors).
      Returns:
      true if everything is OK, false if it is not.
    • addPropagatingUser

      boolean addPropagatingUser​(U u, java.util.List<I> propagatedPieces)
      Adds the propagated pieces of a single user to the iteration
      Parameters:
      u - the user identifier.
      propagatedPieces - the list of pieces that this user has propagated this iteration.
      Returns:
      true if everything is OK, false if it is not.
    • addDiscardingUser

      boolean addDiscardingUser​(U u, java.util.List<I> discardedPieces)
      Adds the discarded pieces of a single user to the iteration
      Parameters:
      u - the user identifier.
      discardedPieces - the list of pieces that this user has discarded this iteration.
      Returns:
      true if everything is OK, false if it is not.
    • getIterationNumber

      int getIterationNumber()
      Obtains the iteration number.
      Returns:
      the iteration number.
    • getNumReceivingUsers

      int getNumReceivingUsers()
      Obtains the number of users which have received and read new information in this iteration.
      Returns:
      the number of users which have received and read new information in this iteration.
    • getNumSeen

      int getNumSeen()
      Obtains the total of number of information pieces which have been read by the different users in the network for the first time during this iteration.
      Returns:
      the number of newly seen information pieces.
    • getNumSeen

      int getNumSeen​(U u)
      Obtains the total number of information pieces which have been read by a user in the network for the first time during this iteration.
      Parameters:
      u - the user
      Returns:
      the number of information pieces which have been read by the user for the first time during this iteration.
    • getNumUniqueSeen

      int getNumUniqueSeen()
      Obtains the number of information pieces which have been read by a user in the network (without taking into acount how many times it has been received during this iteration).
      Returns:
      the number of newly seen information pieces (without frequency).
    • getNumUniqueSeen

      int getNumUniqueSeen​(U u)
      Obtains the total number of different information pieces which have been read by a user in the network for the first time during this iteration.
      Parameters:
      u - the user
      Returns:
      the number of different information pieces which have been read by the user for the first time during this iteration.
    • getReceivingUsers

      java.util.stream.Stream<U> getReceivingUsers()
      Obtains the set of users which have received and read, at least, one piece of information which they had not read before.
      Returns:
      a stream containing users which have received and read, at least, one piece of information which they had not read before.
    • getSeenInformation

      java.util.stream.Stream<Tuple2oo<I,​java.util.Set<U>>> getSeenInformation​(U u)
      Obtains the set of information pieces that a given user has read for the first time during this iteration.
      Parameters:
      u - the user
      Returns:
      the set of information pieces that the user has read for the first time during this iteration.
    • getNumReReceivingUsers

      int getNumReReceivingUsers()
      Obtains the number of users which have received and read information pieces they had read before.
      Returns:
      the number of users which have received and read information pieces they had read before.
    • getNumReReceived

      int getNumReReceived()
      Obtains the total number of information pieces which have been read by the different users in the network after they had read them in previous iterations.
      Returns:
      the number of seen information pieces which had been read before.
    • getNumReReceived

      int getNumReReceived​(U u)
      Obtains the total number of information pieces which have been seen by a user (considering that the user had read them before).
      Parameters:
      u - the user.
      Returns:
      the total number of information pieces which have been seen by the user (considering that the user had read them before).
    • getNumUniqueReReceived

      int getNumUniqueReReceived()
      Obtains the number of information pieces which have been read by a user in the network (without taking into acount how many times it has been received during this iteration), considering that the user had read them before.
      Returns:
      the number of seen information pieces (without frequency) which had been read before.
    • getNumUniqueReReceived

      int getNumUniqueReReceived​(U u)
      Obtains the total number of different information pieces which have been read by a user in the network during this iteration after they were read in a previous iteration.
      Parameters:
      u - the user.
      Returns:
      the number of different information pieces which have been read by the user after they were read in a previous iteration..
    • getReReceivingUsers

      java.util.stream.Stream<U> getReReceivingUsers()
      Obtains the set of users which have received and read, at least, one piece of information they had read before.
      Returns:
      the set of users which have received and read, at least, one piece of information they had read before.
    • getReReceivedInformation

      java.util.stream.Stream<Tuple2oo<I,​java.util.Set<U>>> getReReceivedInformation​(U u)
      Obtains the set of information that a given user read in previous iterations, and have been re-read in this one.
      Parameters:
      u - the user.
      Returns:
      the set of information that the user read in previous iterations, and have been re-read in this one.
    • getNumPropagatingUsers

      int getNumPropagatingUsers()
      Obtains the total number of users which have propagated information pieces.
      Returns:
      the total number of users which have propagated information pieces.
    • getNumPropagated

      int getNumPropagated()
      Obtains the total number of propagated information pieces (it does not take into account how many people received them).
      Returns:
      the total number of propagated information pieces (it does not take into account how many people received them).
    • getNumPropagated

      int getNumPropagated​(U u)
      Obtains the total number of information pieces that a given user has propagated during this iteration. It does not take into account how many people received (just how many different pieces there are).
      Parameters:
      u - the user
      Returns:
      the total number of information pieces that the user has propagated during this iteration.
    • getPropagatingUsers

      java.util.stream.Stream<U> getPropagatingUsers()
      Obtains the set of users which have propagated, at least, one information piece during this iteration.
      Returns:
      the set of users which have propagated, at least, one information piece during this iteration.
    • getPropagatedInformation

      java.util.stream.Stream<I> getPropagatedInformation​(U u)
      Obtains the set of information pieces that a given user has propagated during this iteration.
      Parameters:
      u - the user.
      Returns:
      the set of information pieces that the user has propagated during this iteration.
    • getNumDiscardingUsers

      int getNumDiscardingUsers()
      Obtains the total number of users which have discarded information pieces.
      Returns:
      the total number of users which have discarded information pieces.
    • getNumDiscarded

      int getNumDiscarded()
      Obtains the total number of discarded information pieces.
      Returns:
      the total number of discarded information pieces.
    • getNumDiscarded

      int getNumDiscarded​(U u)
      Obtains the total number of information pieces that a given user has discarded during this iteration.
      Parameters:
      u - the user.
      Returns:
      the total number of information pieces that the user has discarded during this iteration.
    • getDiscardingUsers

      java.util.stream.Stream<U> getDiscardingUsers()
      Obtains the set of users which have discarded, at least, one information piece during this iteration.
      Returns:
      the set of users which have discarded, at least, one information piece during this iteration.
    • getDiscardedInformation

      java.util.stream.Stream<I> getDiscardedInformation​(U u)
      Obtains the set of information pieces that a given user has discarded during this iteration.
      Parameters:
      u - the user.
      Returns:
      the set of information pieces that the user has discarded during this iteration.
    • getTotalReceived

      default int getTotalReceived()
      Obtains the total number of read information pieces during this iteration.
      Returns:
      the total number of read information pieces during this iteration.
    • getTotalReceived

      default int getTotalReceived​(U u)
      Obtains the total number of information pieces that a given user has read during this iteration.
      Parameters:
      u - the user.
      Returns:
      the total number of information pieces that a given user has read during this iteration.