Class GridReader

java.lang.Object
es.uam.eps.ir.relison.grid.GridReader
Direct Known Subclasses:
AlgorithmGridReader, CommunityDetectionGridReader, LinkPredictionMetricGridReader, MetricGridReader, RecommMetricGridReader, RerankerGridReader

public abstract class GridReader
extends java.lang.Object
Class for reading a grid of parameters from a YAML file. Given a single parameter, the file should have the following form:
param_name:
type: value_of_type
values: [value1,value2,...,valueN] or value
range:
- start: startingValue
end: endingValue
step: stepValue
- start: ...
objects:
name_of_the_object:
param_name1:
type: value_of_the_type
...
We should note that
  • objects is the only tag that appears if we have to retrieve an internal object which has its own parameters (i.e. similarities * in UB kNN). For them, this class reads a grid of parameters.
  • range is only allowed for numeric values.
  • values is only compulsory in numeric values if range does not appear.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private static java.lang.String END
    Identifier for the end of an interval
    private static java.lang.String OBJECTS
    The identifier for the values in objects of the grid type.
    private static java.lang.String RANGE
    Identifier for a range of values
    private static java.lang.String START
    Identifier for the start of an interval
    private static java.lang.String STEP
    Identifier for the interval step
    private static java.lang.String TYPE
    Identifier for the parameter type
    private static java.lang.String VALUES
    Identifier for the values of the parameter
  • Constructor Summary

    Constructors 
    Constructor Description
    GridReader()  
  • Method Summary

    Modifier and Type Method Description
    protected java.util.List<java.lang.Boolean> readBooleanGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads boolean values from a grid
    protected java.util.List<java.lang.Double> readDoubleGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads double values from a grid.
    protected java.util.Map<java.lang.String,​Grid> readGridGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads a grid of grids.
    protected java.util.List<java.lang.Integer> readIntegerGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Obtains the integer values for a grid search.
    protected java.util.List<java.lang.Long> readLongGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads long values from a grid
    protected java.util.List<EdgeOrientation> readOrientationGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads edge orientation values from a grid
    protected Grid readParameterGrid​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
    Given a map containing the different parameters to read, obtains a grid storing the different possible values for each single parameter.
    protected java.util.List<java.lang.String> readStringGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Reads string values from a grid

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • readParameterGrid

      protected Grid readParameterGrid​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Given a map containing the different parameters to read, obtains a grid storing the different possible values for each single parameter.
      Parameters:
      parameters - a map, indexed by parameter name, containing the different values.
      Returns:
      the configured grid.
    • readIntegerGrid

      protected java.util.List<java.lang.Integer> readIntegerGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Obtains the integer values for a grid search.
      Parameters:
      map - a map containing the possible values for the parameter.
      Returns:
      the list of integer values.
    • readLongGrid

      protected java.util.List<java.lang.Long> readLongGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads long values from a grid
      Parameters:
      map - a map containing the possible values for the parameter.
      Returns:
      The list of long values
    • readDoubleGrid

      protected java.util.List<java.lang.Double> readDoubleGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads double values from a grid.
      Parameters:
      map - a map containing the possible values for the parameter.
      Returns:
      the list of double values.
    • readStringGrid

      protected java.util.List<java.lang.String> readStringGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads string values from a grid
      Parameters:
      map - a map containing the possible values for the parameter.
      Returns:
      the list of string values.
    • readBooleanGrid

      protected java.util.List<java.lang.Boolean> readBooleanGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads boolean values from a grid
      Parameters:
      map - the map containing the values for the grid.
      Returns:
      the list of boolean values.
    • readGridGrid

      protected java.util.Map<java.lang.String,​Grid> readGridGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads a grid of grids.
      Parameters:
      map - the map containing the values for the grid.
      Returns:
      the list of grids.
    • readOrientationGrid

      protected java.util.List<EdgeOrientation> readOrientationGrid​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Reads edge orientation values from a grid
      Parameters:
      map - the map containing the values for the grid.
      Returns:
      the list of edge orientation values.