Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Michele Volpato
Alnos
Commits
70f59417
Commit
70f59417
authored
Oct 13, 2015
by
Michele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test class for learning with 2 sets
parent
58ffec81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
tests/learning_algorithm2_test.py
tests/learning_algorithm2_test.py
+46
-0
No files found.
tests/learning_algorithm2_test.py
0 → 100644
View file @
70f59417
# Test learning algorithm with double set observation table
import
os
,
inspect
from
nose.tools
import
*
from
learning.learning
import
LearningAlgorithm
,
LearningAlgorithm2Sets
from
teachers.ltsteachers
import
InputOutputTeacher
from
systems.implementations
import
InputOutputLTS
from
teachers.ltsoracles
import
InputOutputPowerOracle
import
helpers.graphhelper
as
gh
import
helpers.bisimulation
as
bi
from
testing.randomtesting
import
RandomTester
class
TestLearningAlgorithm2
:
def
setUp
(
self
):
inputs
=
set
([
'a'
,
'b'
])
outputs
=
set
([
'x'
,
'y'
])
quiescence
=
'delta'
self
.
I1
=
InputOutputLTS
(
5
,
inputs
,
outputs
,
quiescence
)
self
.
I1
.
addTransition
(
0
,
'a'
,
1
)
self
.
I1
.
addTransition
(
0
,
'a'
,
2
)
self
.
I1
.
addTransition
(
0
,
'b'
,
0
)
self
.
I1
.
addTransition
(
1
,
'a'
,
0
)
self
.
I1
.
addTransition
(
1
,
'b'
,
3
)
self
.
I1
.
addTransition
(
2
,
'a'
,
0
)
self
.
I1
.
addTransition
(
2
,
'b'
,
3
)
self
.
I1
.
addTransition
(
2
,
'x'
,
4
)
self
.
I1
.
addTransition
(
3
,
'a'
,
0
)
self
.
I1
.
addTransition
(
3
,
'x'
,
4
)
self
.
I1
.
addTransition
(
3
,
'b'
,
3
)
self
.
I1
.
addTransition
(
4
,
'y'
,
2
)
self
.
I1
.
addTransition
(
4
,
'b'
,
4
)
self
.
I1
.
addTransition
(
4
,
'a'
,
0
)
self
.
I1
.
makeInputEnabled
()
self
.
T1
=
InputOutputTeacher
(
self
.
I1
)
self
.
O1
=
InputOutputPowerOracle
(
self
.
I1
)
self
.
tester
=
RandomTester
(
self
.
T1
,
1000
,
20
)
self
.
L1
=
LearningAlgorithm2Sets
(
self
.
T1
,
self
.
O1
,
self
.
tester
)
def
creation_test
(
self
):
self
.
_Hminus
,
self
.
_Hplus
=
self
.
L1
.
run
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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