Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
35674081
Commit
35674081
authored
Aug 02, 2016
by
Maxime Perrotin
Browse files
Add function that yields neighbor states
parent
896f78c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
35674081
...
...
@@ -664,9 +664,39 @@ class sdlHandler(QObject):
# Send a message every 100 ms.. Should be configurable
QTimer
().
singleShot
(
100
,
self
.
random_step
)
def
children_states
(
self
):
''' Call all available interfaces with all possible values and yield
the resulting state hash plus the transition that caused it
This function does not filter out the states that were already
visited - it is exhaustive. '''
def
exhaust_interface
(
name
,
asn1_ty
):
''' For all combinations of a given interface parameter, execute
the PI, save the resulting state, undo, and yield the state '''
if
asn1_ty
:
for
arg
in
compute_combinations
(
asn1_ty
,
self
.
proc
.
dataview
):
self
.
click_tc
(
name
,
arg
)
new_hash
=
self
.
current_hash
self
.
undo
()
yield
new_hash
,
(
name
,
arg
)
else
:
self
.
click_tc
(
name
)
new_hash
=
self
.
current_hash
self
.
undo
()
yield
new_hash
,
(
name
,
None
)
for
name
in
self
.
active_tc
:
# Start from the current state
asn1_ty
=
None
for
inp
in
self
.
proc
.
input_signals
:
if
inp
[
'name'
].
lower
()
==
name
.
lower
():
sort
=
inp
.
get
(
'type'
,
None
)
if
sort
:
asn1_ty
=
self
.
proc
.
dataview
[
sort
.
ReferencedTypeName
]
exhaust_interface
(
name
,
ty
)
def
exhaustive_simulation
(
self
):
''' Model checker - try all combinations of all inputs in all
possible states, and verify properties on the fly '''
# DEPRECATED FUNCTION
print
'Exhaustive simulation (Breadth first)'
next_level
=
[]
self
.
sim_param
[
'state'
]
=
'exhaustive'
...
...
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