Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
5ffe8d89
Commit
5ffe8d89
authored
Dec 20, 2019
by
VIGNET Pierre
Browse files
[lib] Fix typos
parent
3c95538f
Changes
1
Hide whitespace changes
Inline
Side-by-side
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
View file @
5ffe8d89
...
...
@@ -607,52 +607,52 @@ class CLUnfolder(object):
.. note:: time index is the number of steps since the begining of the
simulation.
:Example - Only standard variables:
__shift_step = 2 (number of variables in the system)
shift_step_init = 2 (number of variables in the system at the initial state)
__var_list = ["##", "n1", "n2"]
Virtual list of indexes in the state vector of a solution:
[0, 1, 2, 3, 4, 5, 6, 7, 8, ...]
#|n1,n2|n1,n2|n1,n2|n1,n2|
ti=0 ti=1 ti=2 ti=3
Given var_num = 7:
index of var_name in __var_list: ((7-1) % 2) + 1 = 1
var_name = "n1"
time index: (7 - 1) / 2 = 3
=> return: "n1_3"
:Example - With an auxiliary variable:
__shift_step = 2 (There is 1 auxiliary variable)
shift_step_init = 1
__var_list = ["##", "n1"]
__aux_list = ["_lit0"]
Virtual list of indexes in the state vector of a solution:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]
#|n1,_lit0|n1,_lit0|n1,_lit0|
ti=0 ti=1 ti=2
If the index is > shift_step_init, then it is an auxiliary
variable. In order to get the index in __aux_list we have to
substract:
-
`
`1` because on the contrary of __var_list, __aux_list begins at index 0
- `shift_step_init` because value of the first aux variable
follows the last value of __var_list
Given var_num = 6
var_code of var_name: ((6-1) % 2) + 1 = 2
2 > shift_step_init
index of var_name in __aux_list:
var_code - shift_step_init - 1
2 -1 -1 = 0
var_name = "_lit0"
=> return: "_lit0_2"
:Example - Only standard variables:
__shift_step = 2 (number of variables in the system)
shift_step_init = 2 (number of variables in the system at the initial state)
__var_list = ["##", "n1", "n2"]
Virtual list of indexes in the state vector of a solution:
[0, 1, 2, 3, 4, 5, 6, 7, 8, ...]
#|n1,n2|n1,n2|n1,n2|n1,n2|
ti=0 ti=1 ti=2 ti=3
Given var_num = 7:
index of var_name in __var_list: ((7-1) % 2) + 1 = 1
var_name = "n1"
time index: (7 - 1) / 2 = 3
=> return: "n1_3"
:Example - With an auxiliary variable:
__shift_step = 2 (There is 1 auxiliary variable)
shift_step_init = 1
__var_list = ["##", "n1"]
__aux_list = ["_lit0"]
Virtual list of indexes in the state vector of a solution:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]
#|n1,_lit0|n1,_lit0|n1,_lit0|
ti=0 ti=1 ti=2
If the index is > shift_step_init, then it is an auxiliary
variable. In order to get the index in __aux_list we have to
substract:
- `1` because on the contrary of __var_list, __aux_list begins at index 0
- `shift_step_init` because value of the first aux variable
follows the last value of __var_list
Given var_num = 6
var_code of var_name: ((6-1) % 2) + 1 = 2
2 > shift_step_init
index of var_name in __aux_list:
var_code - shift_step_init - 1
2 -1 -1 = 0
var_name = "_lit0"
=> return: "_lit0_2"
@param var_num: DIMACS literal coding
@return: name of the variable with the time index appended
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment