Class MaxTimestampStopCondition<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.stop.MaxTimestampStopCondition<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 MaxTimestampStopCondition<U extends java.io.Serializable,I extends java.io.Serializable,F> extends java.lang.Object implements StopCondition<U,I,F>
Stop condition that determines a maximum possible timestamp for the execution.
-
Field Summary
Fields Modifier and Type Field Description private long
maxTimestamp
Maximum possible timestamp. -
Constructor Summary
Constructors Constructor Description MaxTimestampStopCondition(long maxTimestamp)
Constructor. -
Method Summary
-
Field Details
-
maxTimestamp
private final long maxTimestampMaximum possible timestamp.
-
-
Constructor Details
-
MaxTimestampStopCondition
public MaxTimestampStopCondition(long maxTimestamp)Constructor.- Parameters:
maxTimestamp
- maximum timestamp. The iteration will stop after this value is passed.
-
-
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:StopCondition
Checks the stop condition.- Specified by:
stop
in 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.
-