Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 12ed8f0b authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] Fix typos; fix doc

parent 21acce7d
No related branches found
No related tags found
No related merge requests found
...@@ -288,7 +288,8 @@ class CLUnfolder(object): ...@@ -288,7 +288,8 @@ class CLUnfolder(object):
# ordered list of DIMACS codes of the frontier variables/places # 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 = [self.__var_code_table[frp] for frp in self.dynamic_system.frontiers]
self.frontier_values.sort() 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 RawSolution.frontier_pos_and_neg_values BACKWARD, encore utilisé avec index
## Cf TestCLUnfolder.test_frontier indexable mais peut etre contourné ## Cf TestCLUnfolder.test_frontier indexable mais peut etre contourné
...@@ -1401,7 +1402,7 @@ class CLUnfolder(object): ...@@ -1401,7 +1402,7 @@ class CLUnfolder(object):
In practice, it is a list with the values (Dimacs code) In practice, it is a list with the values (Dimacs code)
of all frontier places of the system. of all frontier places of the system.
:type max_sol: <int> :type max_sol: <int>
:type vvars: <list <int>> :type vvars: <list <int>> or <frozenset <int>> or any iterable
:return: A tuple of RawSolution objects :return: A tuple of RawSolution objects
RawSolution objects contain a solution got from SAT solver with all RawSolution objects contain a solution got from SAT solver with all
variable parameters from the unfolder variable parameters from the unfolder
...@@ -1525,9 +1526,6 @@ class CLUnfolder(object): ...@@ -1525,9 +1526,6 @@ class CLUnfolder(object):
variable parameters from the unfolder variable parameters from the unfolder
:rtype: <tuple <RawSolution>> :rtype: <tuple <RawSolution>>
""" """
if LOGGER.getEffectiveLevel() == DEBUG:
LOGGER.debug("squery_solve :: vvars : %s", vvars)
# Initialization # Initialization
self.init_forward_unfolding() self.init_forward_unfolding()
# Horizon adjustment # Horizon adjustment
......
...@@ -246,8 +246,9 @@ class RawSolution(object): ...@@ -246,8 +246,9 @@ class RawSolution(object):
frontiers (fixed size): 3824 frontiers (fixed size): 3824
solution (increasing size): 171231, 228314, 285405, 285453, 400091 etc. solution (increasing size): 171231, 228314, 285405, 285453, 400091 etc.
@param sol: a dimacs solution :return: A dimacs code set of the activation state on the frontiers for
@return: a dimacs code list of the activation state on the frontier for sol the current solution.
:rtype: <frozenset <int>>
""" """
# Old API # Old API
# jmax = len(self.unfolder.frontier_values) # jmax = len(self.unfolder.frontier_values)
...@@ -305,9 +306,9 @@ class RawSolution(object): ...@@ -305,9 +306,9 @@ class RawSolution(object):
j += 1 j += 1
if j == jmax: if j == jmax:
# all frontiers are found # all frontiers are found
return fsol return frozenset(fsol)
frontier = frontiers[j] frontier = frontiers[j]
return fsol # never reach this point return frozenset(fsol) # never reach this point
# Useless proposition # Useless proposition
# ps: jmax allows to stop the search when the iteration is made on solution # ps: jmax allows to stop the search when the iteration is made on solution
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment