Hello folks,
yes, another question if I may:
I have written a specialized LSO for my problem derived from IntVarLocalSearchOperator. However, it seems that the overloaded methods of MakeNextNeighbor is not called. The optimizer will happily find NextNeighbors() for teh IntVars (verified using gdb) but my overloaded methods are not called. I get the impression, that I am missing some form of initialization here. The high leve code is:
class NetworkOperator (pywrapcp.IntVarLocalSearchOperator):
def __init__(self, vars, pathsolver, all_paths, num_demands, cycles, toplevel):
<Init of SuperClass>
my suff
def MakeNextNeighbor(self, delta, deltadelta):
<caclulate my neighborhood>
<logic per LSO example>
....
network_operator = NetworkOperator (decision_vars, pathsolver,
all_paths, demandindex-1, cycle_basis,
toplevel_nodes)
inner_db = LNSSolver.Phase(decision_vars,
LNSSolver.CHOOSE_RANDOM,
LNSSolver.ASSIGN_MIN_VALUE)
inner_limit = LNSSolver.Limit(2000000000,
2000000000,
FLAGS.fail_limit,
2000000000)
sl2 = LNSSolver.SearchLog(1,decision_vars[0])
continuation_db = LNSSolver.SolveOnce (inner_db, inner_limit, sl2)
# search_parameters=LNSSolver.LocalSearchPhaseParameters(lns_operator, continuation_db)
search_parameters = LNSSolver.LocalSearchPhaseParameters(network_operator, inner_db)
final_db = LNSSolver.LocalSearchPhase(decision_vars,db,
search_parameters)
LNSSolver.NewSearch(final_db,[objective, search_log])
Any pointers where I deviated from teh plan ?
Best Regards,
/Dirk