Commit e388a4c6 authored by Michele's avatar Michele

fixed some perfomance issues, some debug code is still there

parent ceb6037d
......@@ -45,7 +45,7 @@ import helpers.bisimulation as bi
import csv
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
HOST = 'localhost'
......
......@@ -54,7 +54,7 @@ class TicTacToeTeacher(AbstractTeacher):
sys.exit()
#self._socket.setblocking(0)
self._socket.settimeout(0.5) # second timeout, for quiescence
self._socket.settimeout(0.1) # timeout, for quiescence
#logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
......@@ -82,7 +82,7 @@ class TicTacToeTeacher(AbstractTeacher):
# Provide output from current state
def output(self):
ready = select.select([self._socket], [], [], 0.3) # second timeout, for quiescence
ready = select.select([self._socket], [], [], 0.1) # second timeout, for quiescence
output = 'delta'
if ready[0]:
output = self._socket.recv(1024).decode("utf-8")
......
This diff is collapsed.
......@@ -145,6 +145,8 @@ class Table:
def _isNotClosed(self, chaos=False):
rows = set()
# search in Eq. classes
eqClasses = self.getEquivalenceClasses(chaos)
# TODO: Is there a faster way to check for global closedness
if self._closeStrategy == "First":
for row in self._rows.difference(self._rowsInS):
......@@ -155,8 +157,6 @@ class Table:
continue
found = False
# search in Eq. classes
eqClasses = self.getEquivalenceClasses(chaos)
for rowInS in eqClasses:
if self._moreSpecificRow(rowInS, row, chaos):
# Found a match, exit
......@@ -297,6 +297,8 @@ class Table:
# I do not need to check it again for other loops. Thus past is outside
# the for loop.
past = set()
# get representative of each equivalence class
eqClasses = self.getEquivalenceClasses(chaos)
# filter rows
for row1 in filter(rowsWithQuiescence, self._rowsInS):
row1Extended = th.flatten(row1 + (self._quiescence,), self._quiescence)
......@@ -306,8 +308,6 @@ class Table:
listOfRows = list(filter(moreSpecific(row1Extended), self._rowsInS))
rowsToCheck = set()
# get representative of each equivalence class
eqClasses = self.getEquivalenceClasses(chaos)
for row in eqClasses:
if row in listOfRows:
rowsToCheck.add(row)
......@@ -534,7 +534,7 @@ class Table:
break
# if newColumns:
# # Only one suffix per round, ok?
# # TODO Only one suffix per round, ok?
# break
# if newColumns:
# break
......
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