diff --git a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py index 274b66bdd8a6983c4a55927ba8687b7e1cb9cd2e..80bd5258d83e969cb21814d10247cc652a99fc8a 100644 --- a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py +++ b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py @@ -201,7 +201,7 @@ class CLUnfolder(object): - trajectory: list of state_vectors """ - def __init__(self, dynamic_system): + def __init__(self, dynamic_system, debug=False): """ :param dynamic_system: Describe a dynamic system in clause form. :type dynamic_system: <CLDynSys> @@ -236,7 +236,10 @@ class CLUnfolder(object): # Fix order of variables names with a list: # - indexes of __var_list are the values of the variables at these indexes # - values begin from 1 (0 is a blacklisted value) - base_var_set = list(dynamic_system.base_var_set) + if debug: + base_var_set = sorted(list(dynamic_system.base_var_set)) + else: + base_var_set = list(dynamic_system.base_var_set) self.__var_list += base_var_set # keys: are the names of the variables, values: their values self.__var_code_table = \ diff --git a/library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py b/library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py index eb8e35d905d489924af1b17118d9be79d9699d51..04ddf459ce47f8e851510db56fb97546eff2db03 100644 --- a/library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py +++ b/library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py @@ -226,22 +226,25 @@ class MCLAnalyser(object): :param nb_sols_to_be_pruned: For mac search: We search a number of solutions that will be pruned later, in order to find the most optimized MAC with a reduced the number of activated frontiers. + :key debug: (optional) Used to activate debug mode in the Unfolder :type dynamical_system: None before loading a model / <CLDynSys> :type unfolder: None before loading a model / <CLUnfolder> + :type debug: False / <boolean> :type reporter: <ErrorRep> :type translator_opti: True / <boolean> :type nb_sols_to_be_pruned: 10 """ - def __init__(self, report): + def __init__(self, report, debug=False): """The built analyser is void by default @param report: a standard reporter """ - self.unfolder = None # computation management: unfolding; type <CLUnfolder> - self.reporter = report # for generic error display - self.translator_opti = True# turn on optimizations for ANTLR translation (subexpression elimination) + self.debug = debug + self.unfolder = None + self.reporter = report + self.translator_opti = True # For mac search: We search a number of solutions that will be pruned # in order to find the most optimized MAC with a reduced the number of @@ -285,7 +288,7 @@ class MCLAnalyser(object): if self.reporter.error: return # Build unfolder - self.unfolder = CLUnfolder(dynamic_system) + self.unfolder = CLUnfolder(dynamic_system, debug=self.debug) def build_from_chart_file(self, file_name): """Build an MCLAnalyser from a .bcx file