As of now Opta Planner planner provides support for:
- Tabu Search.
- Simulated Annealing.
However if i need to implement any other algorithm like Genetic Algorithm with Opta Planner then where and how could it could be used. I have got the code of genetic algorithm, however i don't know how to integrate it with Opta planner. I found few places where it may be possible.
- Inside custom Score class.
- Inside custom Move class.
- Inside custom MoveFactory class.
- In the XML configuration file.
Kindly guide where i need to do the modification.
Thanks
Actually, a student (Sam Van Malderen) already forked OptaPlanner and added a Genetic Algorithm implementation. I guided his work.
Here's the source code. It works. He wrote a custom SolverPhase
and reused Selector
, Move
, Termination
and ScoreDirector
.
Based on that work, we've been able to identify a number of issues (here's the jira to track) to make OptaPlanner more friendly to implement population based metaheuristics.
That being said, the results of that genetic algorithm implementation were consistently inferior to Tabu Search and Late Acceptance on all non-small datasets on all tested use cases. Personally, I don't think the fault lies within the implementation... I am not a strong believer of GA's, but OptaPlanner needs fully support them out-of-the-box one day (even if it's only to prove that Local Search works better). So I definitely welcome any work to add GA's to OptaPlanner.
If you want me to put you in contact with Sam to get a copy of his thesis (which described which GA techniques he implemented), let me know :)
PS: Another quick alternative is to implement a custom solver phase. Much easier, but you can only reuse the score calculation plumbing.
来源:https://stackoverflow.com/questions/19375657/implementing-custom-metaheuristic-in-optaplanner