java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
es.urjc.etsii.grafo.events.types.MorkEvent
es.urjc.etsii.grafo.events.types.SolutionGeneratedEvent<S,I>
- Type Parameters:
S- Solution typeI- Instance type
- All Implemented Interfaces:
Serializable
-
Field Summary
Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionSolutionGeneratedEvent(boolean success, String iteration, String instancePath, S solution, String experimentName, Algorithm<S, I> algorithm, long executionTime, long timeToBest, MetricsStorage metrics, List<TimeStatsEvent> timeStatsEvents) Create a new SolutionGeneratedEvent -
Method Summary
Modifier and TypeMethodDescriptionAlgorithm that created this solutionGet short algorithm name that generated this solutionlongTotal execution time in nanoseconds used by the algorithm to create the solution.Experiment nameInstance used to create this solutionWhich iteration this solution corresponds toGet both framework calculated and user defined propertiesSolution score when finished processing a solution.Get solution instance IF AVAILABLE Storing all generated solutions is too memory expensive.longExecution time until last modification in nanosecondsbooleanWas the solution generated successfully?Methods inherited from class MorkEvent
equals, getEventId, getType, getWorkerName, hashCodeMethods inherited from class org.springframework.context.ApplicationEvent
getTimestampMethods inherited from class EventObject
getSource, toString
-
Constructor Details
-
SolutionGeneratedEvent
public SolutionGeneratedEvent(boolean success, String iteration, String instancePath, S solution, String experimentName, Algorithm<S, I> algorithm, long executionTime, long timeToBest, MetricsStorage metrics, List<TimeStatsEvent> timeStatsEvents) Create a new SolutionGeneratedEvent- Parameters:
iteration- solution iterationsolution- generated solutionexperimentName- experiment namealgorithm- algorithm that generated this solutionexecutionTime- time used to generate this solutiontimeToBest- time needed ot reach the best solution. timeToBest = totalTime - timeSinceLastModificationmetrics- both framework calculated and user defined metricstimeStatsEvents-
-
-
Method Details
-
getIteration
-
getExperimentName
-
getAlgorithm
-
getInstanceName
-
getObjectives
-
getExecutionTime
public long getExecutionTime()Total execution time in nanoseconds used by the algorithm to create the solution.- Returns:
- time in nanos
-
getTimeToBest
public long getTimeToBest()Execution time until last modification in nanoseconds- Returns:
- time in nanos
-
getAlgorithmName
Get short algorithm name that generated this solution- Returns:
- Short string representing the algorithm that generated this solution
-
getSolution
-
getMetrics
Get both framework calculated and user defined properties- Returns:
- Map where key is metric name, value property value as calculated by the user provided function
-
isSuccess
public boolean isSuccess()Was the solution generated successfully?- Returns:
- true if the solution was generated successfully, false otherwise
-