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 booleanaddDiscardingUser(U u, java.util.List<I> discardedPieces)Adds the discarded pieces of a single user to the iterationbooleanaddPropagatingUser(U u, java.util.List<I> propagatedPieces)Adds the propagated pieces of a single user to the iterationbooleanaddReceivingUser(U u, java.util.Map<I,java.util.Set<U>> seenPieces)Adds the received pieces of a single user to the iteration.booleanaddReReceivingUser(U u, java.util.Map<I,java.util.Set<U>> rereceivedPieces)Adds the re-received pieces of a single user discarded pieces to the iterationjava.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.intgetIterationNumber()Obtains the iteration number.intgetNumDiscarded()Obtains the total number of discarded information pieces.intgetNumDiscarded(U u)Obtains the total number of information pieces that a given user has discarded during this iteration.intgetNumDiscardingUsers()Obtains the total number of users which have discarded information pieces.intgetNumPropagated()Obtains the total number of propagated information pieces (it does not take into account how many people received them).intgetNumPropagated(U u)Obtains the total number of information pieces that a given user has propagated during this iteration.intgetNumPropagatingUsers()Obtains the total number of users which have propagated information pieces.intgetNumReceivingUsers()Obtains the number of users which have received and read new information in this iteration.intgetNumReReceived()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.intgetNumReReceived(U u)Obtains the total number of information pieces which have been seen by a user (considering that the user had read them before).intgetNumReReceivingUsers()Obtains the number of users which have received and read information pieces they had read before.intgetNumSeen()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.intgetNumSeen(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.intgetNumUniqueReReceived()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.intgetNumUniqueReReceived(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.intgetNumUniqueSeen()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).intgetNumUniqueSeen(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 intgetTotalReceived()Obtains the total number of read information pieces during this iteration.default intgetTotalReceived(U u)Obtains the total number of information pieces that a given user has read during this iteration.
-
Method Details
-
addReceivingUser
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
-