Class IOManager<S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.services.IOManager<S,I>
Type Parameters:
S - Solution class
I - Instance class

@Service public class IOManager<S extends Solution<S,I>,I extends Instance> extends Object
IO Service to export solutions, errors and load instances
  • Constructor Details

    • IOManager

      public IOManager(ErrorConfig errorConfig, List<SolutionSerializer<S,I>> solutionSerializers)
      Initialize IOManager
      Parameters:
      errorConfig - error configuration
      solutionSerializers - solution serializers
  • Method Details

    • exportSolution

      public void exportSolution(WorkUnitResult<S,I> r, SolutionExportFrequency current)
      Write a solution to disk.
      Parameters:
      r - work unit result
      current - current frequency
    • exportError

      public void exportError(String experimentName, Algorithm<S,I> alg, I i, Throwable t, String stacktrace)
      Export an error to disk
      Parameters:
      experimentName - current experiment name
      alg - algorithm where this error generated from
      i - instance being solved when the error was thrown
      t - Error thrown
      stacktrace - Error stacktrace as string