|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
There is a great deal of flexibility
in defining these moves. A move could be toggling
a binary variable on or off. It could be swapping
two variables in a sequence. The important thing
is that it affects the solution in some way and is
also able to undo itself immediately afterward.
For each move generated by the TSMoveManager
the engine operate
s on the current solution,
evaluate
s it with the objective function and
penalty function, and then performs undoOperation
TSFunction
,
TSSolution
Method Summary | |
boolean |
conflictsWith(TSMove move)
If a number of moves have improving solutions and do not affect each other, the TSEngine will execute
all of these moves at that iteration. |
void |
operateOn(TSSolution soln)
The required method operateOn accepts
a solution to modify and does so. |
void |
undoOperation(TSSolution soln)
A move needs to be able to undo itself. |
Method Detail |
public void operateOn(TSSolution soln)
operateOn
accepts
a solution to modify and does so. Note that a new
solution is not returned. The original solution
is modified.soln
- The solution to be modified.TSSolution
public void undoOperation(TSSolution soln)
TSEngine
evaluates a solution, it does not
create a copy before a move operates on it. This results
in a significant performance increase, but the TSMove
needs to be more sophisticated and be able to undo itself.soln
- Solution to be un-operated on.TSSolution
public boolean conflictsWith(TSMove move)
TSEngine
will execute
all of these moves at that iteration.
For example, in a Traveling Salesman Problem moving customers around in one vehicle's tour probably does not affect moving customers in another vehicle's tour. If this is true for your problem, you can specify that a particular move does or does not conflict with the passed move object.
To be considered "not conflicting" the incremental value of making one move must be independent of the incremental value of making another. In other words if delta-X is the extra value (objective function + penalty function) for making move X and delta-Y is the extra value for making move Y, then the new solution's total value must be equal to the old value + delta-X + delta-Y.
For traditional tabu search behavior, always return
true
move
- The move to compare this one to.TSSolution
,
TSFunction
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |