Class SimulationState<U extends java.io.Serializable,​I extends java.io.Serializable,​P>

java.lang.Object
es.uam.eps.ir.relison.diffusion.simulation.SimulationState<U,​I,​P>
Type Parameters:
U - Type of the users.
I - type of the information pieces.
P - type of the parameter values.

public class SimulationState<U extends java.io.Serializable,​I extends java.io.Serializable,​P>
extends java.lang.Object
Stores the current state of a simulation.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.Map<U,​UserState<U>> userState
    Current state of the users.
  • Constructor Summary

    Constructors 
    Constructor Description
    SimulationState()  
  • Method Summary

    Modifier and Type Method Description
    void clear()
    Clears the structures for a new simulation.
    java.util.stream.Stream<UserState<U>> getAllUsers()
    Gets the state of all users.
    UserState<U> getUser​(U u)
    Obtains the state of the user.
    void initialize​(Data<U,​I,​P> data)
    Initializes the different structures for the simulation.

    Methods inherited from class java.lang.Object

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

    • userState

      private final java.util.Map<U extends java.io.Serializable,​UserState<U extends java.io.Serializable>> userState
      Current state of the users.
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Clears the structures for a new simulation.
    • initialize

      public void initialize​(Data<U,​I,​P> data)
      Initializes the different structures for the simulation.
      Parameters:
      data - the simulation data.
    • getUser

      public UserState<U> getUser​(U u)
      Obtains the state of the user.
      Parameters:
      u - the user.
      Returns:
      the state of the user.
    • getAllUsers

      public java.util.stream.Stream<UserState<U>> getAllUsers()
      Gets the state of all users.
      Returns:
      the state of all users.