Package es.urjc.etsii.grafo.executors
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWorkUnitResult(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(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(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 aWorkUnitResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.computeSolutionProperties(S solution) static <S extends Solution<S,I>, I extends Instance>
WorkUnitResult<S, I> copyBestAlg(WorkUnitResult<S, I> workUnit) static <S extends Solution<S,I>, I extends Instance>
WorkUnitResult<S, I> copyBestInstance(WorkUnitResult<S, I> workUnit) final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexecutionTimerecord component.Returns the value of theexperimentNamerecord component.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) final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceIdrecord component.Returns the value of theinstancePathrecord component.Returns the value of theiterationrecord component.metrics()Returns the value of themetricsrecord component.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) solution()Returns the value of thesolutionrecord component.Returns the value of thesolutionPropertiesrecord component.booleansuccess()Returns the value of thesuccessrecord component.timeData()Returns the value of thetimeDatarecord component.longReturns the value of thetimeToTargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
BEST_ALGORITHM
- See Also:
-
BEST_ITERATION
- See Also:
-
-
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
-
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 aWorkUnitResultrecord class.- Parameters:
success- the value for thesuccessrecord componentexperimentName- the value for theexperimentNamerecord componentinstancePath- the value for theinstancePathrecord componentinstanceId- the value for theinstanceIdrecord componentalgorithm- the value for thealgorithmrecord componentiteration- the value for theiterationrecord componentsolution- the value for thesolutionrecord componentsolutionProperties- the value for thesolutionPropertiesrecord componentexecutionTime- the value for theexecutionTimerecord componenttimeToTarget- the value for thetimeToTargetrecord componentmetrics- the value for themetricsrecord componenttimeData- the value for thetimeDatarecord component
-
-
Method Details
-
ok
public static <S extends Solution<S,I>, WorkUnitResult<S,I extends Instance> 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>, WorkUnitResult<S,I extends Instance> I> failure(WorkUnit<S, I> workUnit, String instanceId, long executionTime, long timeToTarget, List<TimeStatsEvent> timeData) -
copyBestAlg
public static <S extends Solution<S,I>, WorkUnitResult<S,I extends Instance> I> copyBestAlg(WorkUnitResult<S, I> workUnit) -
copyBestInstance
public static <S extends Solution<S,I>, WorkUnitResult<S,I extends Instance> I> copyBestInstance(WorkUnitResult<S, I> workUnit) -
computeSolutionProperties
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
experimentName
Returns the value of theexperimentNamerecord component.- Returns:
- the value of the
experimentNamerecord component
-
instancePath
Returns the value of theinstancePathrecord component.- Returns:
- the value of the
instancePathrecord component
-
instanceId
Returns the value of theinstanceIdrecord component.- Returns:
- the value of the
instanceIdrecord component
-
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
iteration
Returns the value of theiterationrecord component.- Returns:
- the value of the
iterationrecord component
-
solution
Returns the value of thesolutionrecord component.- Returns:
- the value of the
solutionrecord component
-
solutionProperties
Returns the value of thesolutionPropertiesrecord component.- Returns:
- the value of the
solutionPropertiesrecord component
-
executionTime
public long executionTime()Returns the value of theexecutionTimerecord component.- Returns:
- the value of the
executionTimerecord component
-
timeToTarget
public long timeToTarget()Returns the value of thetimeToTargetrecord component.- Returns:
- the value of the
timeToTargetrecord component
-
metrics
Returns the value of themetricsrecord component.- Returns:
- the value of the
metricsrecord component
-
timeData
Returns the value of thetimeDatarecord component.- Returns:
- the value of the
timeDatarecord component
-