fix ls examples in python/java/C#

This commit is contained in:
Laurent Perron
2015-11-20 18:43:11 +01:00
parent 0e5f017c97
commit 3e78e18cd5
6 changed files with 522 additions and 15 deletions

View File

@@ -3,11 +3,11 @@ from google.apputils import app
import gflags
import random
class OneVarLns(pywrapcp.PyLns):
class OneVarLns(pywrapcp.BaseLns):
"""One Var LNS."""
def __init__(self, vars):
pywrapcp.PyLns.__init__(self, vars)
pywrapcp.BaseLns.__init__(self, vars)
self.__index = 0
def InitFragments(self):
@@ -15,10 +15,11 @@ class OneVarLns(pywrapcp.PyLns):
def NextFragment(self):
if self.__index < self.Size():
self.AppendToFragment(self.__index)
self.__index += 1
return [self.__index - 1]
return True
else:
return []
return False
class MoveOneVar(pywrapcp.IntVarLocalSearchOperator):