Class SimulationParameterReader

java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.diffusion.SimulationParameterReader

public class SimulationParameterReader
extends ParametersReader
Reads a YAML file containing the configuration for simulating information diffusion. File format:
simulations:
- protocol: ...
filters:
filter_name:
filter_param_1: ...
filter_param_2: ...
...
filter_name:
...
stop:
- protocol: ...
  • Field Details

  • Constructor Details

  • Method Details

    • read

      public void read​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads the configuration parameters from a file.
      Parameters:
      map - a map containing the configurations for a simulation.
    • readSimulation

      private void readSimulation​(java.util.Map<java.lang.String,​java.lang.Object> element)
      Reads the grid for a single simulation.
      Parameters:
      element - a map containing the configuration of the simulation.
    • numberSimulations

      public int numberSimulations()
      Obtains the number of available simulations.
      Returns:
      the number of available simulations.
    • getPreconfiguredProtocols

      public java.util.Set<ProtocolParameterReader> getPreconfiguredProtocols()
      Obtains the set of preconfigured protocols previously read.
      Returns:
      The set of preconfigured protocols previously read.
    • getCustomProtocols

      public java.util.Set<ProtocolParameterReader> getCustomProtocols()
      Obtains the set of custom protocols previously read.
      Returns:
      The set of custom protocols previously read.
    • getSimulation

      public Triplet<ProtocolParameterReader,​java.util.List<FilterParameterReader>,​StopConditionParameterReader> getSimulation​(int num)
      Gets the different elements for a simulation.
      Parameters:
      num - the index of the simulation.
      Returns:
      a triplet containing:
      1. The parameters for the protocol
      2. The parameters for the filter
      3. The parameters for the stop condition
      if the index is correct, null if not
    • getProtocolParameters

      public ProtocolParameterReader getProtocolParameters​(int num)
      Gets the protocol parameters for a given simulation.
      Parameters:
      num - the index of the simulation.
      Returns:
      the protocol parameters.
    • getFilterParameters

      public java.util.List<FilterParameterReader> getFilterParameters​(int num)
      Gets the filter parameters for a given simulation.
      Parameters:
      num - the index of the simulation.
      Returns:
      the filter parameters.
    • getStopConditionParameters

      public StopConditionParameterReader getStopConditionParameters​(int num)
      Gets the stop condition parameters for a given simulation.
      Parameters:
      num - the index of the simulation.
      Returns:
      the stop condition parameters.
    • printSimulation

      public java.lang.String printSimulation​(int num)
      Obtains a string detailing the simulation parameters.
      Parameters:
      num - the index of the simulation.
      Returns:
      a string detailing the simulation parameters.