Class IndividualSamplingAlgorithmGridReader

java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.links.recommendation.sampling.IndividualSamplingAlgorithmGridReader

public class IndividualSamplingAlgorithmGridReader
extends ParametersReader
Reads the grid for sampling algorithms from a YAML file.
  • Field Details

    • SAMPLERS

      private static final java.lang.String SAMPLERS
      String for identifying the samplers in the file:
      See Also:
      Constant Field Values
    • samplersGrid

      private final java.util.Map<java.lang.String,​Parameters> samplersGrid
      Algorithms grid. Uses a grid for each algorithm.
  • Constructor Details

  • Method Details

    • read

      public void read​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads a YAML document containing a grid.
      Parameters:
      map - a map containing the grid information.
    • readIndividualSamplingAlgorithm

      private void readIndividualSamplingAlgorithm​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
      Reads the grid for a single algorithm.
      Parameters:
      element - the YAML element containing the algorithm information.
    • getIndividualSamplingAlgorithms

      public java.util.Set<java.lang.String> getIndividualSamplingAlgorithms()
      Gets the set of algorithms previously read.
      Returns:
      the set of algorithms previously read from the grid file.
    • getParameters

      public Parameters getParameters​(java.lang.String algorithm)
      Gets the grid for a given algorithm.
      Parameters:
      algorithm - the algorithm to search.
      Returns:
      the grid if exists, an empty grid if not.