최적화 알고리즘 구성은 선택 사항입니다. 즉, <constructionHeuristic>
이없고 <localSearch>
이없는 경우 OptaPlanner는 적절한 기본 구성을 사용합니다 (하나의 Construction Heuristic 단계와 하나의 Local Search 단계로 구성됩니다). 따라서 계획이 실행되고 알고리즘없이 간단한 테스트에서 결과를 얻을 수 있습니다 단계가 구성됨
<constructionHeuristic>
을 직접 추가하면 OptaPlanner는 더 이상 기본 구성을 사용하지 않습니다.이 시점에서 First Fit Decreasing 알고리즘을 실행하는 단일 Construction Heuristic 단계가 구성되었습니다.
자동 구성 휴리스틱 종단은이 단계가 모든 ent 계획 변수가 초기화됩니다. 따라서이 단계에서는 <termination>
을 구성 할 필요가 없습니다.
지금해야 할 일은 <constructionHeuristic>
단계 다음에 <localSearch>
단계를 추가하고 지역 검색 알고리즘 중 일부 (예 : 언덕 등반)의 기본 구성으로 시작하는 것입니다. 구성 예제는 로컬 검색 장을 참조하십시오. 그래서 예를 들어
:
<?xml version="1.0" encoding="UTF-8"?>
<solver>
<!-- Define the model -->
<scanAnnotatedClasses/>
<!-- Define the score function -->
<scoreDirectorFactory>
...
</scoreDirectorFactory>
<!-- Configure solver (global) termination -->
<termination>
<secondsSpentLimit>20</secondsSpentLimit>
</termination>
<!-- Configure the optimization algorithms (optional) -->
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
</constructionHeuristic>
<localSearch>
<localSearchType>HILL_CLIMBING</localSearchType>
<acceptor>
<acceptorType>HILL_CLIMBING</acceptorType>
</acceptor>
<forager>
<acceptedCountLimit>1</acceptedCountLimit>
</forager>
<!-- You can also configure phase termination -->
<termination>
<stepCountLimit>100</stepCountLimit>
</termination>
</localSearch>
</solver>
무엇'DEBUG' 로그 상태는 무엇입니까? –