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
b2c20ecd
Commit
b2c20ecd
authored
5 years ago
by
VIGNET Pierre
Browse files
Options
Downloads
Patches
Plain Diff
[lib] Add few todos.. sorry
parent
477ef5c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
+12
-0
12 additions, 0 deletions
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
with
12 additions
and
0 deletions
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
+
12
−
0
View file @
b2c20ecd
...
@@ -74,6 +74,8 @@ About shifting clauses and variables:
...
@@ -74,6 +74,8 @@ About shifting clauses and variables:
to the right or to the left depending on whether their values are positive
to the right or to the left depending on whether their values are positive
or negative.
or negative.
*constraints attributes are shifted at every step and submitted to the solver.
---
---
init_with_query(query):
init_with_query(query):
...
@@ -1291,12 +1293,15 @@ class CLUnfolder(object):
...
@@ -1291,12 +1293,15 @@ class CLUnfolder(object):
self
.
__aux_list
=
[]
# idem
self
.
__aux_list
=
[]
# idem
# Init properties to generate all variable num codes
# Init properties to generate all variable num codes
## Similar code with init_backward_unfolding, move this into a function
## => could help to recall init state of a query
self
.
__init_initial_constraint_0
()
self
.
__init_initial_constraint_0
()
self
.
__init_final_constraint_0
()
self
.
__init_final_constraint_0
()
self
.
__init_invariant_constraint_0
()
self
.
__init_invariant_constraint_0
()
self
.
__init_variant_constraints_0
()
self
.
__init_variant_constraints_0
()
# Now shifting is possible
# Now shifting is possible
## TODO: check shift_direction too (not urgent, backward is not usable)
if
old_shift_step
!=
self
.
__shift_step
\
if
old_shift_step
!=
self
.
__shift_step
\
or
self
.
__include_aux_clauses_changed
\
or
self
.
__include_aux_clauses_changed
\
or
not
self
.
__dynamic_constraints
:
or
not
self
.
__dynamic_constraints
:
...
@@ -1307,6 +1312,7 @@ class CLUnfolder(object):
...
@@ -1307,6 +1312,7 @@ class CLUnfolder(object):
self
.
__forward_init_dynamic
()
self
.
__forward_init_dynamic
()
self
.
__precomputed_dynamic_constraints
=
[]
self
.
__precomputed_dynamic_constraints
=
[]
else
:
else
:
# Optimization for __dynamic_constraints
# Main settings of the unfolder haven't changed and the system
# Main settings of the unfolder haven't changed and the system
# was initialized before.
# was initialized before.
LOGGER
.
info
(
"
init_forward_unfolding:: Reload dynamic constraints
"
)
LOGGER
.
info
(
"
init_forward_unfolding:: Reload dynamic constraints
"
)
...
@@ -1346,6 +1352,12 @@ class CLUnfolder(object):
...
@@ -1346,6 +1352,12 @@ class CLUnfolder(object):
.. note:: Called by:
.. note:: Called by:
- __constraints_satisfied()
- __constraints_satisfied()
- __msolve_constraints()
- __msolve_constraints()
.. todo::
Avoid to reload the solver everytime just for a few changed variables.
Ex: __initial_constraints is changed only because of
__initial_property and __dimacs_initial changes.
Ex: __dynamic_constraints is huge and stays the same.
"""
"""
# New API via C++ module
# New API via C++ module
solv
.
add_clauses
(
self
.
__final_constraints
)
solv
.
add_clauses
(
self
.
__final_constraints
)
...
...
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