Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cadbiom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNET Pierre
cadbiom
Commits
232470de
Commit
232470de
authored
5 years ago
by
VIGNET Pierre
Browse files
Options
Downloads
Patches
Plain Diff
[lib] Ability to fix the order of literals and their values in debug/test mode
parent
12c909a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
+5
-2
5 additions, 2 deletions
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py
+8
-5
8 additions, 5 deletions
library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py
with
13 additions
and
7 deletions
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
+
5
−
2
View file @
232470de
...
...
@@ -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
=
\
...
...
This diff is collapsed.
Click to expand it.
library/cadbiom/models/clause_constraints/mcl/MCLAnalyser.py
+
8
−
5
View file @
232470de
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment