Class TotalPropagatedStopCondition<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.stop.TotalPropagatedStopCondition<U,I,F>
- Type Parameters:
U- type of the users.I- type of the information pieces.F- type of the user and information pieces features.
- All Implemented Interfaces:
StopCondition<U,I,F>
public class TotalPropagatedStopCondition<U extends java.io.Serializable,I extends java.io.Serializable,F> extends java.lang.Object implements StopCondition<U,I,F>
Stops after a given number of information pieces has been propagated.
-
Field Summary
Fields Modifier and Type Field Description private longlimitMaximum number of propagated pieces. -
Constructor Summary
Constructors Constructor Description TotalPropagatedStopCondition(long limit)Constructor. -
Method Summary
-
Field Details
-
limit
private final long limitMaximum number of propagated pieces.
-
-
Constructor Details
-
TotalPropagatedStopCondition
public TotalPropagatedStopCondition(long limit)Constructor.- Parameters:
limit- maximum number of propagated pieces.
-
-
Method Details
-
stop
public boolean stop(int numIter, int numPropagated, int propagatingUsers, long newlyPropagated, long totalPropagated, Data<U,I,F> data, java.lang.Long timestamp)Description copied from interface:StopConditionChecks the stop condition.- Specified by:
stopin interfaceStopCondition<U extends java.io.Serializable,I extends java.io.Serializable,F>- Parameters:
numIter- the current number of iterations.numPropagated- the number of information pieces which has been propagated during this iteration.propagatingUsers- the number of users who propagate information.newlyPropagated- the number of information pieces which have been seen this iteration.totalPropagated- the total number of information pieces which have been propagated during the simulation.data- the simulation data.timestamp- the timestamp corresponding to the current iteration.- Returns:
- true if the simulator has to stop, false if not.
-