Commit f1487b75 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] CLUnfolder.__msolve_constraints and MCLAnalyser.__mac_exhaustive_search...

[lib] CLUnfolder.__msolve_constraints and MCLAnalyser.__mac_exhaustive_search now return tuples => Creation is more efficient
parent 3eeafe50
......@@ -976,7 +976,7 @@ class CLUnfolder(object):
"""
@param max_sol: int - the max number of solution returned
@param vvars: variables for which the solver must find different solutions(dimacs code)
@return: a list of RawSolution
@return: a tuple of RawSolution
"""
solver = CryptoMS()
self.__load_solver(solver)
......@@ -995,8 +995,8 @@ class CLUnfolder(object):
LOGGER.debug("__msolve_constraints :: lintsol : " + str(lintsol))
return [RawSolution(solint, self) for solint in lintsol]
return [RawSolution(solint, self)
for solint in solver.msolve_selected(max_sol, vvars)]
return tuple(RawSolution(solint, self)
for solint in solver.msolve_selected(max_sol, vvars))
# dynamic properties
def squery_is_satisfied(self, max_step):
......@@ -1057,8 +1057,8 @@ class CLUnfolder(object):
# search for solutions at each step
while self.__current_step <= max_step:
lsol = self.__msolve_constraints(max_sol, vvars)
if len(lsol)>0:
l_rawsol = l_rawsol + lsol
if lsol:
l_rawsol.extend(lsol)
self.shift()
return l_rawsol
......
......@@ -349,7 +349,7 @@ class MCLAnalyser(object):
"""
@param query: MCLQuery
@param nb_step: int - number of dynamical step
@return list<DimacsFrontierSol>
@return tuple<DimacsFrontierSol>
"""
# list of timed minimal activation conditions on frontier (dimacs code)
# i.e list<DimacsFrontierSol>
......@@ -390,7 +390,7 @@ class MCLAnalyser(object):
reachable = False
else :
mac_list.append(current_mac)
return mac_list
return tuple(mac_list)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment