Record Class WorkUnitResult<S extends Solution<S,I>,I extends Instance>

java.lang.Object
java.lang.Record
es.urjc.etsii.grafo.executors.WorkUnitResult<S,I>

public record WorkUnitResult<S extends Solution<S,I>,I extends Instance>(boolean success, String experimentName, String instancePath, String instanceId, Algorithm<S extends Solution<S,I>,I extends Instance> algorithm, String iteration, S extends Solution<S,I> solution, Map<String,Object> solutionProperties, long executionTime, long timeToTarget, MetricsStorage metrics, List<TimeStatsEvent> timeData) extends Record
  • Field Details

  • Constructor Details

    • WorkUnitResult

      public WorkUnitResult(boolean success, String experimentName, String instancePath, String instanceId, Algorithm<S,I> algorithm, int iteration, S solution, long executionTime, long timeToTarget, MetricsStorage metrics, List<TimeStatsEvent> timeData)
    • WorkUnitResult

      public WorkUnitResult(boolean success, String experimentName, String instancePath, String instanceId, Algorithm<S,I> algorithm, String iteration, S solution, long executionTime, long timeToTarget, MetricsStorage metrics, List<TimeStatsEvent> timeData)
    • WorkUnitResult

      public WorkUnitResult(boolean success, String experimentName, String instancePath, String instanceId, Algorithm<S,I> algorithm, String iteration, S solution, Map<String,Object> solutionProperties, long executionTime, long timeToTarget, MetricsStorage metrics, List<TimeStatsEvent> timeData)
      Creates an instance of a WorkUnitResult record class.
      Parameters:
      success - the value for the success record component
      experimentName - the value for the experimentName record component
      instancePath - the value for the instancePath record component
      instanceId - the value for the instanceId record component
      algorithm - the value for the algorithm record component
      iteration - the value for the iteration record component
      solution - the value for the solution record component
      solutionProperties - the value for the solutionProperties record component
      executionTime - the value for the executionTime record component
      timeToTarget - the value for the timeToTarget record component
      metrics - the value for the metrics record component
      timeData - the value for the timeData record component
  • Method Details

    • ok

      public static <S extends Solution<S, I>, I extends Instance> WorkUnitResult<S,I> ok(WorkUnit<S,I> workUnit, String instanceId, S solution, long executionTime, long timeToTarget, MetricsStorage metrics, List<TimeStatsEvent> timeData)
    • failure

      public static <S extends Solution<S, I>, I extends Instance> WorkUnitResult<S,I> failure(WorkUnit<S,I> workUnit, String instanceId, long executionTime, long timeToTarget, List<TimeStatsEvent> timeData)
    • copyBestAlg

      public static <S extends Solution<S, I>, I extends Instance> WorkUnitResult<S,I> copyBestAlg(WorkUnitResult<S,I> workUnit)
    • copyBestInstance

      public static <S extends Solution<S, I>, I extends Instance> WorkUnitResult<S,I> copyBestInstance(WorkUnitResult<S,I> workUnit)
    • computeSolutionProperties

      public static <S extends Solution<S, I>, I extends Instance> Map<String,Object> computeSolutionProperties(S solution)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • success

      public boolean success()
      Returns the value of the success record component.
      Returns:
      the value of the success record component
    • experimentName

      public String experimentName()
      Returns the value of the experimentName record component.
      Returns:
      the value of the experimentName record component
    • instancePath

      public String instancePath()
      Returns the value of the instancePath record component.
      Returns:
      the value of the instancePath record component
    • instanceId

      public String instanceId()
      Returns the value of the instanceId record component.
      Returns:
      the value of the instanceId record component
    • algorithm

      public Algorithm<S,I> algorithm()
      Returns the value of the algorithm record component.
      Returns:
      the value of the algorithm record component
    • iteration

      public String iteration()
      Returns the value of the iteration record component.
      Returns:
      the value of the iteration record component
    • solution

      public S solution()
      Returns the value of the solution record component.
      Returns:
      the value of the solution record component
    • solutionProperties

      public Map<String,Object> solutionProperties()
      Returns the value of the solutionProperties record component.
      Returns:
      the value of the solutionProperties record component
    • executionTime

      public long executionTime()
      Returns the value of the executionTime record component.
      Returns:
      the value of the executionTime record component
    • timeToTarget

      public long timeToTarget()
      Returns the value of the timeToTarget record component.
      Returns:
      the value of the timeToTarget record component
    • metrics

      public MetricsStorage metrics()
      Returns the value of the metrics record component.
      Returns:
      the value of the metrics record component
    • timeData

      public List<TimeStatsEvent> timeData()
      Returns the value of the timeData record component.
      Returns:
      the value of the timeData record component