You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I need Python 3.7 to run the code because of some dependencies. Previously, I got no error like this by using Python 2.7. While trying to add a new constraint to the model. I get the following error stating that there is no attribute named "domain_" in the class "Element". I have checked the class with its super classes. It says the truth.
I have already checked the diff of two different versions of the module Numberjack, but there is no difference at the corresponding code segment.
Another problem is that while creating an Element object, it passes a slice object to the end of the children list which causes an error on the line 710 where it checks the following condition:
if exp.ident == -1:
because one of the exp objects comes as slice object resulting from the slice object.
Could you please help me to solve this issue? I could not cope with it by myself.
Thank you in advance!!
135 self.__model += (Sum(self.__Start[job]) == 1) # only 1 number of Start
136 self.__model += (Sum(self.__End[job]) == 1) # only 1 number of End
--> 137 self.__model += (Sum(self.__Start[job][release_time:deadline]) == 1) # only 1 number of Start between release and deadline
138 self.__model += (Sum(self.__End[job][release_time:deadline+1]) == 1) # only 1 number of End between release and deadline
139 self.__model += (Sum(self.__End[job][t+1] * (t+1) for t in range(release_time, deadline)) - Sum(self.__Start[job][t] * t for t in range(release_time, deadline)) > 0)
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in init(self, vars, coefs, offset)
2022
2023 def init(self, vars, coefs=None, offset=0):
-> 2024 Predicate.init(self, vars, "Sum")
2025
2026 if coefs is None:
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in set_children(self, children)
1454 ## List of children of the predicate
1455 #self.children = [child for child in children]
-> 1456 self.children = flatten(children)
1457
1458 def initial(self):
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in flatten(x)
29 def flatten(x):
30 result = []
---> 31 for el in x:
32 if hasattr(el, "iter") and not isinstance(el, str) and not issubclass(type(el), Expression):
33 result.extend(flatten(el))
Hi,
Recently, I need Python 3.7 to run the code because of some dependencies. Previously, I got no error like this by using Python 2.7. While trying to add a new constraint to the model. I get the following error stating that there is no attribute named "domain_" in the class "Element". I have checked the class with its super classes. It says the truth.
I have already checked the diff of two different versions of the module Numberjack, but there is no difference at the corresponding code segment.
Another problem is that while creating an Element object, it passes a slice object to the end of the children list which causes an error on the line 710 where it checks the following condition:
if exp.ident == -1:
because one of the exp objects comes as slice object resulting from the slice object.
Could you please help me to solve this issue? I could not cope with it by myself.
Thank you in advance!!
135 self.__model += (Sum(self.__Start[job]) == 1) # only 1 number of Start
136 self.__model += (Sum(self.__End[job]) == 1) # only 1 number of End
--> 137 self.__model += (Sum(self.__Start[job][release_time:deadline]) == 1) # only 1 number of Start between release and deadline
138 self.__model += (Sum(self.__End[job][release_time:deadline+1]) == 1) # only 1 number of End between release and deadline
139 self.__model += (Sum(self.__End[job][t+1] * (t+1) for t in range(release_time, deadline)) - Sum(self.__Start[job][t] * t for t in range(release_time, deadline)) > 0)
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in init(self, vars, coefs, offset)
2022
2023 def init(self, vars, coefs=None, offset=0):
-> 2024 Predicate.init(self, vars, "Sum")
2025
2026 if coefs is None:
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in init(self, vars, op)
1447 def init(self, vars, op):
1448 Expression.init(self, op)
-> 1449 self.set_children(vars)
1450
1451 def set_children(self, children):
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in set_children(self, children)
1454 ## List of children of the predicate
1455 #self.children = [child for child in children]
-> 1456 self.children = flatten(children)
1457
1458 def initial(self):
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in flatten(x)
29 def flatten(x):
30 result = []
---> 31 for el in x:
32 if hasattr(el, "iter") and not isinstance(el, str) and not issubclass(type(el), Expression):
33 result.extend(flatten(el))
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in iter(self)
243
244 def iter(self):
--> 245 return self.get_domain()
246
247 def get_solver(self):
~/workspace/LFOS/latestPy3.7Env/lib/python3.7/site-packages/Numberjack/init.py in get_domain(self, solver)
398 dom.append(v)
399 return Domain(dom)
--> 400 elif self.domain_ is not None:
401 return Domain(self.domain_)
402 else:
AttributeError: 'Element' object has no attribute 'domain_
The text was updated successfully, but these errors were encountered: