|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbasics.VehicleRoutingAlgorithm
public class VehicleRoutingAlgorithm
Algorithm that solves a VehicleRoutingProblem.
| Field Summary | |
|---|---|
static int |
NOBREAK
|
| Constructor Summary | |
|---|---|
VehicleRoutingAlgorithm(VehicleRoutingProblem problem,
java.util.Collection<VehicleRoutingProblemSolution> initialSolutions,
SearchStrategyManager searchStrategyManager)
|
|
VehicleRoutingAlgorithm(VehicleRoutingProblem problem,
SearchStrategyManager searchStrategyManager)
|
|
| Method Summary | |
|---|---|
void |
addInitialSolution(VehicleRoutingProblemSolution solution)
Adds solution to the collection of initial solutions. |
VehicleRoutingAlgorithmListeners |
getAlgorithmListeners()
|
int |
getNuOfIterations()
Returns the number of iterations. |
SearchStrategyManager |
getSearchStrategyManager()
Gets the SearchStrategyManager. |
java.util.Collection<VehicleRoutingProblemSolution> |
searchSolutions()
Runs the vehicle routing algorithm and returns a number of generated solutions. |
void |
setNuOfIterations(int nOfIterations)
|
void |
setPrematureAlgorithmBreaker(PrematureAlgorithmBreaker prematureAlgorithmBreaker)
|
void |
setPrematureBreak(int nuIterationsWithoutImprovement)
Sets premature break. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NOBREAK
| Constructor Detail |
|---|
public VehicleRoutingAlgorithm(VehicleRoutingProblem problem,
SearchStrategyManager searchStrategyManager)
public VehicleRoutingAlgorithm(VehicleRoutingProblem problem,
java.util.Collection<VehicleRoutingProblemSolution> initialSolutions,
SearchStrategyManager searchStrategyManager)
| Method Detail |
|---|
public void addInitialSolution(VehicleRoutingProblemSolution solution)
solution - public void setPrematureBreak(int nuIterationsWithoutImprovement)
This breaks the algorithm prematurely after the assigned number of iterations without improvement (see input parameter).
Improvement is what SolutionAcceptor understands about improvement. Or to put it in other words, the algo breaks prematurely after
the assigned number of iterations without solution-acceptance.
nuIterationsWithoutImprovement - public void setPrematureAlgorithmBreaker(PrematureAlgorithmBreaker prematureAlgorithmBreaker)
public SearchStrategyManager getSearchStrategyManager()
SearchStrategyManager.
public java.util.Collection<VehicleRoutingProblemSolution> searchSolutions()
The algorithm runs as long as it is specified in nuOfIterations and prematureBreak. In each iteration it selects a searchStrategy according to searchStrategyManager and runs the strategy to improve solutions.
Note that clients are allowed to observe/listen the algorithm. See VehicleRoutingAlgorithmListener and its according listeners.
SearchStrategyManager}, {@link VehicleRoutingAlgorithmListener}, {@link AlgorithmStartsListener}, {@link AlgorithmEndsListener}, {@link IterationStartsListener}, {@link IterationEndsListener}public int getNuOfIterations()
public VehicleRoutingAlgorithmListeners getAlgorithmListeners()
public void setNuOfIterations(int nOfIterations)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||