Class BackupSimulation

java.lang.Object
es.uam.eps.ir.relison.diffusion.data.BackupSimulation

public class BackupSimulation
extends java.lang.Object
Representation of the backup of a simulation.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.List<java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>>> iterations
    The backup of the simulation.
  • Constructor Summary

    Constructors 
    Constructor Description
    BackupSimulation()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void addIteration​(java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>> iteration)
    Adds a new iteration.
    java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>> getIteration​(int iteration)
    Gets an iteration.
    java.util.stream.Stream<java.lang.Integer> getModifiedUsers​(int iteration)
    Gets a stream of the users that have received a new information piece during a given iteration.
    java.util.stream.Stream<java.lang.Integer> getNewPieces​(int iteration, int user)
    Gets a stream with the information pieces received by a single user during an iteration.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • iterations

      private final java.util.List<java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>>> iterations
      The backup of the simulation.
  • Constructor Details

  • Method Details

    • addIteration

      public void addIteration​(java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>> iteration)
      Adds a new iteration.
      Parameters:
      iteration - the iteration of the simulation
    • getIteration

      public java.util.Map<java.lang.Integer,​java.util.List<java.lang.Integer>> getIteration​(int iteration)
      Gets an iteration.
      Parameters:
      iteration - the iteration of the simulation
      Returns:
      iterations.
    • getModifiedUsers

      public java.util.stream.Stream<java.lang.Integer> getModifiedUsers​(int iteration)
      Gets a stream of the users that have received a new information piece during a given iteration.
      Parameters:
      iteration - the iteration.
      Returns:
      the users that have received new information pieces during that iteration.
    • getNewPieces

      public java.util.stream.Stream<java.lang.Integer> getNewPieces​(int iteration, int user)
      Gets a stream with the information pieces received by a single user during an iteration.
      Parameters:
      iteration - the iteration.
      user - the user.
      Returns:
      the new pieces received during the iteration.