Mentions légales du service

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

[lib] MCLA: fix typos

parent 40cb72c7
No related branches found
No related tags found
No related merge requests found
...@@ -398,11 +398,20 @@ class MCLAnalyser(object): ...@@ -398,11 +398,20 @@ class MCLAnalyser(object):
Repeat the operation until there is only one solution. Repeat the operation until there is only one solution.
:param fsol: A DimacsFrontierSol for which we assume/assert that the
system is satisfiable.
:type fsol: <DimacsFrontierSol> :type fsol: <DimacsFrontierSol>
:type query: <MCLSimpleQuery> :type query: <MCLSimpleQuery>
:rtype: <DimacsFrontierSol> :rtype: <DimacsFrontierSol>
ASSERT: fsol is a frontier condition implying sq satisfiability .. todo::
- regarder si les solutions dimacs_solutions sont si différentes.
il est possible que le solveur soit relativement optimisé pour qu'on
puisse en demander moins ou qu'on puisse éliminer les solutions les
moins diversifiées (détection d'un ensemble commun de places dont on
forcerait l'inactivation pas l'intermédiaire d'une clause de l'état
initial).
- ajuster automatiquement nb_sols_to_be_pruned (10 actuellement)
""" """
# for debug - too expansive to be activated anytime # for debug - too expansive to be activated anytime
# assert(self.sq_is_satisfiable(query, max_step)) # assert(self.sq_is_satisfiable(query, max_step))
...@@ -436,9 +445,6 @@ class MCLAnalyser(object): ...@@ -436,9 +445,6 @@ class MCLAnalyser(object):
i, i,
len(dimacs_solutions) len(dimacs_solutions)
) )
####TODO: regarder si ces solutions sont si différentes et ce qu'on en fait au final...
### en fin de compte il est possible que le solveur ne soit pas si bete...
##TODO: ajuster automatiquement nb_sols_to_be_pruned
# PS: dimacs_solutions should never be None or empty # PS: dimacs_solutions should never be None or empty
if len(dimacs_solutions) == 1: if len(dimacs_solutions) == 1:
...@@ -701,20 +707,18 @@ class MCLAnalyser(object): ...@@ -701,20 +707,18 @@ class MCLAnalyser(object):
# (see squery_is_satisfied() and squery_solve()) # (see squery_is_satisfied() and squery_solve())
query.steps_before_check = min_step - 1 query.steps_before_check = min_step - 1
LOGGER.info("Solution reachable in min_step: %s", min_step)
while reachable: while reachable:
# Forbidden solutions: already discovered macs (see at the end of the while loop) LOGGER.info("Solution reachable in min_step: %s", min_step)
# Forbidden solutions: already discovered macs
# (see at the end of the current loop).
# Ban all sets of activated frontiers (1 set = 1 solution) # Ban all sets of activated frontiers (1 set = 1 solution)
# Equivalent of wrapping each previous solution with a logical OR: # Equivalent of wrapping each previous solution with a logical AND:
# OR( not (frontier places)) # AND(not(frontier places))
## TODO: check in unfolder: dim_start elements joined by OR or AND operator ?
## TODO: keep previous dim_start à la première itération (mettre le contenu dans forbidden values)
query.dim_start = list(forbidden_frontier_values) query.dim_start = list(forbidden_frontier_values)
print("query variant prop", query.variant_prop) print("query variant prop", query.variant_prop)
## TODO: equivaut à mettre à jour le start_prop ou __initial_property avec l'ancienne méthode ??
## si non, faudrait ptetre éviter de recompiler ça à chaque fois dans __init_initial_constraint_0 #### redondance partielle avec next_mac()
#### redondance code next_mac()
# Solutions differ on frontiers: Search only 2 different solutions # Solutions differ on frontiers: Search only 2 different solutions
# to avoid all activated solutions # to avoid all activated solutions
# Get <tuple <DimacsFrontierSol>> # Get <tuple <DimacsFrontierSol>>
...@@ -725,7 +729,7 @@ class MCLAnalyser(object): ...@@ -725,7 +729,7 @@ class MCLAnalyser(object):
LOGGER.info("MCLA: NOT FOUND -> satis test; current step %s", LOGGER.info("MCLA: NOT FOUND -> satis test; current step %s",
self.unfolder.current_step) self.unfolder.current_step)
if self.unfolder.current_step + 1 > max_user_step: if self.unfolder.current_step == max_user_step:
# Cosmetic break, avoid to do useless test # Cosmetic break, avoid to do useless test
break break
...@@ -745,7 +749,7 @@ class MCLAnalyser(object): ...@@ -745,7 +749,7 @@ class MCLAnalyser(object):
self.unfolder._CLUnfolder__steps_before_check += 1 self.unfolder._CLUnfolder__steps_before_check += 1
ret = self.unfolder.squery_is_satisfied(max_user_step) ret = self.unfolder.squery_is_satisfied(max_user_step)
if not ret: if not ret:
# The problem is definitly not satisfiable in the given # The problem is definitively not satisfiable in the given
# number of steps # number of steps
break break
# __steps_before_check can't be >= min_step # __steps_before_check can't be >= min_step
...@@ -837,7 +841,7 @@ class MCLAnalyser(object): ...@@ -837,7 +841,7 @@ class MCLAnalyser(object):
the horizon on which the properties must be satisfied the horizon on which the properties must be satisfied
@return: <generator <FrontierSolution>> @return: <generator <FrontierSolution>>
""" """
## TODO convert start_property in dim_start !! => eviter la recompilation des propriétés ## TODO: convert start_property in dim_start !! => eviter la recompilation des propriétés
# Get <generator <DimacsFrontierSol>> # Get <generator <DimacsFrontierSol>>
mac_list = self.__mac_exhaustive_search(query, max_step) mac_list = self.__mac_exhaustive_search(query, max_step)
# Convert to a generator of FrontierSolution objects # Convert to a generator of FrontierSolution objects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment