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 aWorkUnitResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithm
record 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 boolean
Indicates whether some other object is "equal to" this one.long
Returns the value of theexecutionTime
record component.Returns the value of theexperimentName
record 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 int
hashCode()
Returns a hash code value for this object.Returns the value of theinstanceId
record component.Returns the value of theinstancePath
record component.Returns the value of theiteration
record component.metrics()
Returns the value of themetrics
record 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 thesolution
record component.Returns the value of thesolutionProperties
record component.boolean
success()
Returns the value of thesuccess
record component.timeData()
Returns the value of thetimeData
record component.long
Returns the value of thetimeToTarget
record component.final String
toString()
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 aWorkUnitResult
record class.- Parameters:
success
- the value for thesuccess
record componentexperimentName
- the value for theexperimentName
record componentinstancePath
- the value for theinstancePath
record componentinstanceId
- the value for theinstanceId
record componentalgorithm
- the value for thealgorithm
record componentiteration
- the value for theiteration
record componentsolution
- the value for thesolution
record componentsolutionProperties
- the value for thesolutionProperties
record componentexecutionTime
- the value for theexecutionTime
record componenttimeToTarget
- the value for thetimeToTarget
record componentmetrics
- the value for themetrics
record componenttimeData
- the value for thetimeData
record 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 thesuccess
record component.- Returns:
- the value of the
success
record component
-
experimentName
Returns the value of theexperimentName
record component.- Returns:
- the value of the
experimentName
record component
-
instancePath
Returns the value of theinstancePath
record component.- Returns:
- the value of the
instancePath
record component
-
instanceId
Returns the value of theinstanceId
record component.- Returns:
- the value of the
instanceId
record component
-
algorithm
Returns the value of thealgorithm
record component.- Returns:
- the value of the
algorithm
record component
-
iteration
Returns the value of theiteration
record component.- Returns:
- the value of the
iteration
record component
-
solution
Returns the value of thesolution
record component.- Returns:
- the value of the
solution
record component
-
solutionProperties
Returns the value of thesolutionProperties
record component.- Returns:
- the value of the
solutionProperties
record component
-
executionTime
public long executionTime()Returns the value of theexecutionTime
record component.- Returns:
- the value of the
executionTime
record component
-
timeToTarget
public long timeToTarget()Returns the value of thetimeToTarget
record component.- Returns:
- the value of the
timeToTarget
record component
-
metrics
Returns the value of themetrics
record component.- Returns:
- the value of the
metrics
record component
-
timeData
Returns the value of thetimeData
record component.- Returns:
- the value of the
timeData
record component
-