Commit 6b968579 authored by Michele's avatar Michele

removed debug code

parent e29dc4f5
......@@ -92,7 +92,7 @@ class LearningAlgorithm:
# Until we tried K times with no results, where K is the number of
# observable traces times the number of outputs (including quiescence)
K = len(oTraces) #* (len(self._teacher.getOutputAlphabet()) + 1)
K = len(oTraces) * 35 # (len(self._teacher.getOutputAlphabet()) + 1) # TODO comment from *
found = 0
tries = 0
while tries < K:
......@@ -297,11 +297,8 @@ class LearningAlgorithm:
def stabilizeTable(self):
# While nothing changes, keep closing and consistent the table
print("stabilizing")
closingRows = self._table.isNotGloballyClosed()
print("found rows to close")
consistentCheck = self._table.isNotGloballyConsistent()
print("found rows to consistent")
while closingRows or consistentCheck:
while closingRows:
self._logger.info("Closing table")
......@@ -345,7 +342,8 @@ 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,6 +360,8 @@ 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
......@@ -446,9 +446,7 @@ class LearningAlgorithm:
self._currentLoop = self._currentLoop + 1
self._logger.info("Learning loop number " + str(self._currentLoop))
# Fill the table and make it closed and consistent
print("updating table")
self.updateTable() # TODO learning sometimes stops here!
print("table updated")
self.stabilizeTable()
# Is the table quiescence reducible? If not make it so and
# then fill it again, make it closed and consitent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment