Commit 3612b6db authored by Michele's avatar Michele

adapted example to new learning algorithm

parent 81372c58
......@@ -10,8 +10,9 @@ from teachers.ltsoracles import InputOutputPowerOracle
import logging
import helpers.bisimulation as bi
from testing.randomtesting import RandomTester
from systems.iopurpose import InputPurpose, OutputPurpose
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
inputs = set(['a','b'])
......@@ -48,6 +49,9 @@ I1.makeInputEnabled()
T1 = InputOutputTeacher(I1)
O1 = InputOutputPowerOracle(I1)
outputExpert = OutputPurpose(set(['x','y', quiescence]))
inputExpert = InputPurpose(set(['a','b']))
tester = RandomTester(T1, 10000, 20)
currentdir = os.path.dirname(os.path.abspath(
......@@ -58,7 +62,9 @@ path = os.path.join(currentdir, "dotFiles")
print("Starting learning...")
# change printPath=None to printPath=path for dot files
L2 = LearningAlgorithm(T1, O1, printPath=None, maxLoops=4, tablePreciseness=10000, logger=logger, tester=tester)
L2 = LearningAlgorithm(T1, O1, printPath=None, maxLoops=4,
tablePreciseness=10000, logger=logger, tester=tester, outputPurpose=outputExpert,
inputPurpose=inputExpert)
minus, plus = L2.run()
print("Models learned. Check language equivalence...")
......
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