OptaPlanner core 6.1.0.Beta2

org.optaplanner.core.api.solver.event
Class BestSolutionChangedEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.optaplanner.core.api.solver.event.BestSolutionChangedEvent
All Implemented Interfaces:
Serializable

public class BestSolutionChangedEvent
extends EventObject

Delivered when the best Solution changes during solving. Delivered in the solver thread (which is the thread that calls Solver.solve(Solution).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BestSolutionChangedEvent(Solver source, long timeMillisSpent, Solution newBestSolution)
           
 
Method Summary
 Solution getNewBestSolution()
           
 long getTimeMillisSpent()
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BestSolutionChangedEvent

public BestSolutionChangedEvent(Solver source,
                                long timeMillisSpent,
                                Solution newBestSolution)
Parameters:
source - never null
timeMillisSpent - >= 0L
newBestSolution - never null
Method Detail

getTimeMillisSpent

public long getTimeMillisSpent()
Returns:
>= 0, the amount of millis spent since the Solver started until getNewBestSolution() was found

getNewBestSolution

public Solution getNewBestSolution()
Returns:
never null

OptaPlanner core 6.1.0.Beta2

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.