Class SimpleIteration<U,I,P>
java.lang.Object
es.uam.eps.ir.relison.diffusion.simulation.SimpleIteration<U,I,P>
- Type Parameters:
U- Type of the users.I- Type of the information pieces.P- Type of the features.
- All Implemented Interfaces:
Iteration<U,I,P>
public class SimpleIteration<U,I,P> extends java.lang.Object implements Iteration<U,I,P>
Class for storing the basic information of a simulation iteration.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<U,java.util.List<I>>discardedPiecesThe set of discarded information pieces observed by each user.private intiterationNumberNumber of the current iteration.private intnumDiscardedNumber of discarded information piecesprivate intnumDiscardingUsersNumber of users which have discarded, at least, one information piece.private intnumPropagatedNumber of propagated information piecesprivate intnumPropagatingUsersNumber of users which have propagated, at least, one information pieceprivate intnumReceivingUsersNumber of users which have read, at least, a new information piece.private intnumReReceivedTotal re-read information pieces for the whole set of users.private intnumReReceivingUsersNumber of users which have read, at least, one information piece which they had read in a previous iteration.private intnumSeenTotal newly observed pieces for the whole set of users.private intnumUniqueReReceivedSum of the number of unique re-read information pieces of each user.private intnumUniqueSeenSum of the number of different newly observed pieces by each userprivate java.util.Map<U,java.util.List<I>>propagatedPiecesThe set of propagated pieces by each user.private java.util.Map<U,java.util.Map<I,java.util.Set<U>>>rereceivedPiecesThe set of re-received information pieces observed by each user (and their creators).private java.util.Map<U,java.util.Map<I,java.util.Set<U>>>seenPiecesThe set of information pieces observed by each user (and their creators). -
Constructor Summary
Constructors Constructor Description SimpleIteration(int iterationNumber)Constructor. -
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.diffusion.simulation.Iteration
getTotalReceived, getTotalReceived
-
Field Details
-
iterationNumber
private final int iterationNumberNumber of the current iteration. -
seenPieces
The set of information pieces observed by each user (and their creators). -
rereceivedPieces
The set of re-received information pieces observed by each user (and their creators). -
propagatedPieces
The set of propagated pieces by each user. -
discardedPieces
The set of discarded information pieces observed by each user. -
numUniqueSeen
private int numUniqueSeenSum of the number of different newly observed pieces by each user -
numSeen
private int numSeenTotal newly observed pieces for the whole set of users. -
numUniqueReReceived
private int numUniqueReReceivedSum of the number of unique re-read information pieces of each user. -
numReReceived
private int numReReceivedTotal re-read information pieces for the whole set of users. -
numPropagated
private int numPropagatedNumber of propagated information pieces -
numDiscarded
private int numDiscardedNumber of discarded information pieces -
numReceivingUsers
private int numReceivingUsersNumber of users which have read, at least, a new information piece. -
numReReceivingUsers
private int numReReceivingUsersNumber of users which have read, at least, one information piece which they had read in a previous iteration. -
numPropagatingUsers
private int numPropagatingUsersNumber of users which have propagated, at least, one information piece -
numDiscardingUsers
private int numDiscardingUsersNumber of users which have discarded, at least, one information piece.
-
-
Constructor Details
-
SimpleIteration
public SimpleIteration(int iterationNumber)Constructor.- Parameters:
iterationNumber- the number of the iteration.
-
-
Method Details
-
addReceivingUser
Description copied from interface:IterationAdds the received pieces of a single user to the iteration.- Specified by:
addReceivingUserin interfaceIteration<U,I,P>- 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
Description copied from interface:IterationAdds the re-received pieces of a single user discarded pieces to the iteration- Specified by:
addReReceivingUserin interfaceIteration<U,I,P>- 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
Description copied from interface:IterationAdds the propagated pieces of a single user to the iteration- Specified by:
addPropagatingUserin interfaceIteration<U,I,P>- 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
Description copied from interface:IterationAdds the discarded pieces of a single user to the iteration- Specified by:
addDiscardingUserin interfaceIteration<U,I,P>- 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
public int getIterationNumber()Description copied from interface:IterationObtains the iteration number.- Specified by:
getIterationNumberin interfaceIteration<U,I,P>- Returns:
- the iteration number.
-
getNumReceivingUsers
public int getNumReceivingUsers()Description copied from interface:IterationObtains the number of users which have received and read new information in this iteration.- Specified by:
getNumReceivingUsersin interfaceIteration<U,I,P>- Returns:
- the number of users which have received and read new information in this iteration.
-
getNumSeen
public int getNumSeen()Description copied from interface:IterationObtains 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.- Specified by:
getNumSeenin interfaceIteration<U,I,P>- Returns:
- the number of newly seen information pieces.
-
getNumSeen
Description copied from interface:IterationObtains the total number of information pieces which have been read by a user in the network for the first time during this iteration.- Specified by:
getNumSeenin interfaceIteration<U,I,P>- 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
public int getNumUniqueSeen()Description copied from interface:IterationObtains 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).- Specified by:
getNumUniqueSeenin interfaceIteration<U,I,P>- Returns:
- the number of newly seen information pieces (without frequency).
-
getNumUniqueSeen
Description copied from interface:IterationObtains the total number of different information pieces which have been read by a user in the network for the first time during this iteration.- Specified by:
getNumUniqueSeenin interfaceIteration<U,I,P>- 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
Description copied from interface:IterationObtains the set of users which have received and read, at least, one piece of information which they had not read before.- Specified by:
getReceivingUsersin interfaceIteration<U,I,P>- Returns:
- a stream containing users which have received and read, at least, one piece of information which they had not read before.
-
getSeenInformation
Description copied from interface:IterationObtains the set of information pieces that a given user has read for the first time during this iteration.- Specified by:
getSeenInformationin interfaceIteration<U,I,P>- Parameters:
u- the user- Returns:
- the set of information pieces that the user has read for the first time during this iteration.
-
getNumReReceivingUsers
public int getNumReReceivingUsers()Description copied from interface:IterationObtains the number of users which have received and read information pieces they had read before.- Specified by:
getNumReReceivingUsersin interfaceIteration<U,I,P>- Returns:
- the number of users which have received and read information pieces they had read before.
-
getNumReReceived
public int getNumReReceived()Description copied from interface:IterationObtains 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.- Specified by:
getNumReReceivedin interfaceIteration<U,I,P>- Returns:
- the number of seen information pieces which had been read before.
-
getNumReReceived
Description copied from interface:IterationObtains the total number of information pieces which have been seen by a user (considering that the user had read them before).- Specified by:
getNumReReceivedin interfaceIteration<U,I,P>- 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
public int getNumUniqueReReceived()Description copied from interface:IterationObtains 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.- Specified by:
getNumUniqueReReceivedin interfaceIteration<U,I,P>- Returns:
- the number of seen information pieces (without frequency) which had been read before.
-
getNumUniqueReReceived
Description copied from interface:IterationObtains 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.- Specified by:
getNumUniqueReReceivedin interfaceIteration<U,I,P>- 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
Description copied from interface:IterationObtains the set of users which have received and read, at least, one piece of information they had read before.- Specified by:
getReReceivingUsersin interfaceIteration<U,I,P>- Returns:
- the set of users which have received and read, at least, one piece of information they had read before.
-
getReReceivedInformation
Description copied from interface:IterationObtains the set of information that a given user read in previous iterations, and have been re-read in this one.- Specified by:
getReReceivedInformationin interfaceIteration<U,I,P>- 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
public int getNumPropagatingUsers()Description copied from interface:IterationObtains the total number of users which have propagated information pieces.- Specified by:
getNumPropagatingUsersin interfaceIteration<U,I,P>- Returns:
- the total number of users which have propagated information pieces.
-
getNumPropagated
public int getNumPropagated()Description copied from interface:IterationObtains the total number of propagated information pieces (it does not take into account how many people received them).- Specified by:
getNumPropagatedin interfaceIteration<U,I,P>- Returns:
- the total number of propagated information pieces (it does not take into account how many people received them).
-
getNumPropagated
Description copied from interface:IterationObtains 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).- Specified by:
getNumPropagatedin interfaceIteration<U,I,P>- Parameters:
u- the user- Returns:
- the total number of information pieces that the user has propagated during this iteration.
-
getPropagatingUsers
Description copied from interface:IterationObtains the set of users which have propagated, at least, one information piece during this iteration.- Specified by:
getPropagatingUsersin interfaceIteration<U,I,P>- Returns:
- the set of users which have propagated, at least, one information piece during this iteration.
-
getPropagatedInformation
Description copied from interface:IterationObtains the set of information pieces that a given user has propagated during this iteration.- Specified by:
getPropagatedInformationin interfaceIteration<U,I,P>- Parameters:
u- the user.- Returns:
- the set of information pieces that the user has propagated during this iteration.
-
getNumDiscardingUsers
public int getNumDiscardingUsers()Description copied from interface:IterationObtains the total number of users which have discarded information pieces.- Specified by:
getNumDiscardingUsersin interfaceIteration<U,I,P>- Returns:
- the total number of users which have discarded information pieces.
-
getNumDiscarded
public int getNumDiscarded()Description copied from interface:IterationObtains the total number of discarded information pieces.- Specified by:
getNumDiscardedin interfaceIteration<U,I,P>- Returns:
- the total number of discarded information pieces.
-
getNumDiscarded
Description copied from interface:IterationObtains the total number of information pieces that a given user has discarded during this iteration.- Specified by:
getNumDiscardedin interfaceIteration<U,I,P>- Parameters:
u- the user.- Returns:
- the total number of information pieces that the user has discarded during this iteration.
-
getDiscardingUsers
Description copied from interface:IterationObtains the set of users which have discarded, at least, one information piece during this iteration.- Specified by:
getDiscardingUsersin interfaceIteration<U,I,P>- Returns:
- the set of users which have discarded, at least, one information piece during this iteration.
-
getDiscardedInformation
Description copied from interface:IterationObtains the set of information pieces that a given user has discarded during this iteration.- Specified by:
getDiscardedInformationin interfaceIteration<U,I,P>- Parameters:
u- the user.- Returns:
- the set of information pieces that the user has discarded during this iteration.
-