1

I am encountering some problems when it comes to modifying the applied algorithms: First, it seems I cannot change the late acceptance algorithm configuration. This is my local search configuration, which works nicely when I am not specifying neither acceptor nor forager:

<localSearch>
    <localSearchType>LATE_ACCEPTANCE</localSearchType>
    <acceptor>
            <lateAcceptanceSize>5000</lateAcceptanceSize>
            <entityTabuRatio>0.1</entityTabuRatio>
            <!--valueTabuSize>10000</valueTabuSize-->
    </acceptor>
    <forager>
        <acceptedCountLimit>1</acceptedCountLimit>
    </forager>
    <termination>
              <minutesSpentLimit>10</minutesSpentLimit>
              <bestScoreLimit>[0/11496/11496]hard/[0]soft</bestScoreLimit>
        </termination>
</localSearch>

I get this error message as part of the output

 java.lang.IllegalArgumentException: The localSearchType (... 
java.lang.IllegalArgumentException: The localSearchType (LATE_ACCEPTANCE) must not be configured if the acceptorConfig (AcceptorConfig()) is explicitly configured.
        at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildAcceptor(LocalSearchPhaseConfig.java:182)
        at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildDecider(LocalSearchPhaseConfig.java:132) 
        at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:117) 
        at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:54) 
        at org.optaplanner.core.config.solver.SolverConfig.buildPhaseList(SolverConfig.java:364) 
        at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:270) 
        at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61) 
        at com.gmv.g2gmps.CBand.App.main(App.java:75) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
        at java.lang.reflect.Method.invoke(Method.java:498) 
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282) 
        at java.lang.Thread.run(Thread.java:748) 
pineapplw
  • 71
  • 3

1 Answers1

1

Finally, I was told that the configuration of LATE_ACCEPTANCE and lateAcceptanceSize at the same time is incompatible. Therefore I set late acceptance size as the only parameter (therefore Late acceptance as an acceptor) instead of writing it down as the local search type.

<localSearch>
    <acceptor>
        <lateAcceptanceSize>5000</lateAcceptanceSize>
        <entityTabuRatio>0.1</entityTabuRatio>
        <!--valueTabuSize>10000</valueTabuSize-->
    </acceptor>
    <forager>
        <acceptedCountLimit>1</acceptedCountLimit>
    </forager>
    <termination>
        <minutesSpentLimit>10</minutesSpentLimit>
        <bestScoreLimit>[0/11496/11496]hard/[0]soft</bestScoreLimit>
    </termination>
</localSearch>
raven
  • 2,381
  • 2
  • 20
  • 44
pineapplw
  • 71
  • 3