Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Alnos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Michele Volpato
Alnos
Commits
d2eb3621
Commit
d2eb3621
authored
Nov 12, 2015
by
Michele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now it is not necessary to specify the alphabets when creating new LTSs
parent
73358705
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
9 deletions
+6
-9
examples/tictactoe/tictacteacher.py
examples/tictactoe/tictacteacher.py
+1
-1
learning/learning.py
learning/learning.py
+1
-4
systems/implementations.py
systems/implementations.py
+3
-3
tests/InputOutputLTS_test.py
tests/InputOutputLTS_test.py
+1
-1
No files found.
examples/tictactoe/tictacteacher.py
View file @
d2eb3621
...
...
@@ -51,7 +51,7 @@ class TicTacToeTeacher(AbstractTeacher):
sys
.
exit
()
#self._socket.setblocking(0)
self
.
_socket
.
settimeout
(
1
)
# 1
second timeout, for quiescence
self
.
_socket
.
settimeout
(
0.5
)
#
second timeout, for quiescence
#logging.basicConfig(level=logging.DEBUG)
logger
=
logging
.
getLogger
(
__name__
)
...
...
learning/learning.py
View file @
d2eb3621
...
...
@@ -342,8 +342,6 @@ class LearningAlgorithm:
self
.
_teacher
.
getOutputAlphabet
().
copy
(),
self
.
_teacher
.
getQuiescence
(),
chaos
)
#if not chaos:
# print(rows)
# assign to each equivalence class a state number
# start with equivalence class of empty trace to 0
assignments
=
{():
0
}
...
...
@@ -362,8 +360,6 @@ class LearningAlgorithm:
for
label
in
allLabels
:
# create row and search it in the table
extension
=
row
+
(
label
,)
#if not chaos:
# print(extension)
if
self
.
_table
.
isInRows
(
extension
):
for
target
in
rows
:
found
=
False
...
...
@@ -372,6 +368,7 @@ class LearningAlgorithm:
if
self
.
_table
.
_moreSpecificRow
(
extension
,
target
,
chaos
):
hyp
.
addTransition
(
assignments
[
row
],
label
,
assignments
[
target
])
found
=
True
break
if
not
found
:
...
...
systems/implementations.py
View file @
d2eb3621
...
...
@@ -130,14 +130,14 @@ class InputOutputLTS(AbstractIOLTS):
validState1
=
state1
<
self
.
_numstates
and
state1
>=
0
validState2
=
state2
<
self
.
_numstates
and
state2
>=
0
if
validState1
and
validState2
:
if
label
in
self
.
_inputs
or
label
in
self
.
_outputs
:
#if label in self._inputs: #
or label in self._outputs:
key
=
(
state1
,
label
)
if
key
in
self
.
_transitions
.
keys
():
self
.
_transitions
[
key
].
add
(
state2
)
else
:
self
.
_transitions
[
key
]
=
set
([
state2
])
else
:
success
=
False
#
else:
#
success = False
else
:
success
=
False
return
success
...
...
tests/InputOutputLTS_test.py
View file @
d2eb3621
...
...
@@ -48,7 +48,7 @@ class TestImplementations:
success
=
I3
.
addTransition
(
1
,
'a'
,
2
)
assert_equal
(
success
,
True
)
success
=
I3
.
addTransition
(
1
,
'c'
,
2
)
assert_equal
(
success
,
Fals
e
)
assert_equal
(
success
,
Tru
e
)
success
=
I3
.
addTransition
(
-
1
,
'a'
,
2
)
assert_equal
(
success
,
False
)
success
=
I3
.
addTransition
(
1
,
'b'
,
4
)
...
...
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