diff --git a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py index 6842ea39711037f5cdd4b574fa7ccc05ab98717d..8e6cc891a02aab4b536757586bba7c8ad196cb45 100644 --- a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py +++ b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py @@ -288,7 +288,8 @@ class CLUnfolder(object): # ordered list of DIMACS codes of the frontier variables/places self.frontier_values = [self.__var_code_table[frp] for frp in self.dynamic_system.frontiers] self.frontier_values.sort() - ## TODO: sort utile ici ???? si non passer en frozenset et supprimer les casts partout ailleurs + ## TODO: Utiliser une liste triée est-il utile ici ? + ## si non passer utiliser un frozenset et supprimer les casts partout ## Cf RawSolution.frontier_pos_and_neg_values BACKWARD, encore utilisé avec index ## Cf TestCLUnfolder.test_frontier indexable mais peut etre contourné @@ -1401,7 +1402,7 @@ class CLUnfolder(object): In practice, it is a list with the values (Dimacs code) of all frontier places of the system. :type max_sol: <int> - :type vvars: <list <int>> + :type vvars: <list <int>> or <frozenset <int>> or any iterable :return: A tuple of RawSolution objects RawSolution objects contain a solution got from SAT solver with all variable parameters from the unfolder @@ -1525,9 +1526,6 @@ class CLUnfolder(object): variable parameters from the unfolder :rtype: <tuple <RawSolution>> """ - if LOGGER.getEffectiveLevel() == DEBUG: - LOGGER.debug("squery_solve :: vvars : %s", vvars) - # Initialization self.init_forward_unfolding() # Horizon adjustment diff --git a/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py b/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py index b681a02f83f1fa876864cd2f9ff373ca523ea4d5..527360f50b962d55712637ce2f1fd3a198034328 100644 --- a/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py +++ b/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py @@ -246,8 +246,9 @@ class RawSolution(object): frontiers (fixed size): 3824 solution (increasing size): 171231, 228314, 285405, 285453, 400091 etc. - @param sol: a dimacs solution - @return: a dimacs code list of the activation state on the frontier for sol + :return: A dimacs code set of the activation state on the frontiers for + the current solution. + :rtype: <frozenset <int>> """ # Old API # jmax = len(self.unfolder.frontier_values) @@ -305,9 +306,9 @@ class RawSolution(object): j += 1 if j == jmax: # all frontiers are found - return fsol + return frozenset(fsol) frontier = frontiers[j] - return fsol # never reach this point + return frozenset(fsol) # never reach this point # Useless proposition # ps: jmax allows to stop the search when the iteration is made on solution