Commit 58ffec81 authored by Michele's avatar Michele

started implementing table with two sets

parent 224e2d2c
from .observationtable import Table
from .observationtable import Table, DoubleSetTable
import random
from systems.implementations import SuspensionAutomaton
import os, inspect
......@@ -551,3 +551,17 @@ class LearningAlgorithm:
if self._logger.isEnabledFor(logging.DEBUG):
self._table.printTable(prefix="_final_")
return (self._hMinus, self._hPlus)
class LearningAlgorithm2Sets(LearningAlgorithm):
def __init__(self, teacher, oracle, tester, tablePreciseness = 1000,
modelPreciseness = 0.1, closeStrategy = None,
printPath = None, maxLoops=10, logger=None):
LearningAlgorithm.__init__(self, teacher, oracle, tester,
tablePreciseness,
modelPreciseness, closeStrategy,
printPath, maxLoops, logger)
self._table = DoubleSetTable(teacher.getInputAlphabet().copy(),
teacher.getOutputAlphabet().copy(),
teacher.getQuiescence(),
closeStrategy, logger=logger)
......@@ -581,3 +581,10 @@ class Table:
else:
rowRow.append(self._entries[trace])
tablewriter.writerow(rowRow)
class DoubleSetTable(Table):
def __init__(self, inputs, outputs, quiescence,
closeStrategy = None, logger=None):
Table.__init__(self, inputs, outputs, quiescence,
closeStrategy, logger)
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