Commit 14498068 authored by Chanelle Lee's avatar Chanelle Lee
Browse files

Made some logging changes

parent 90bae687
......@@ -22,7 +22,9 @@ def main(numSims=10):
logger.critical('Could not connect to streaming server')
time.sleep(5)
testParams = pd.read_csv('testParams.csv', index_col='id')
for paramNum in set(testParams_DF.index.values):
for paramNum in set(testParams.index.values):
if param < 5: # This just allows us to skip the ones already tested
continue
logger.info('Param num: {}'.format(paramNum))
simNum = 0
for i in range(0, numSims):
......@@ -70,7 +72,9 @@ def start(paramNum, simNum, noise, distrust):
time.sleep(0.1)
controllerJobs = [ControllerThread(name='controller{}'.format(e.ID),
ePuck=e) for e in ePucks]
ePuck=e,
paramNum=paramNum,
simNum=simNum) for e in ePucks]
for p in controllerJobs:
p.start()
time.sleep(0.1)
......
......@@ -60,7 +60,7 @@ propagate = 0
[logger_myThreads]
handlers = consoleHandler
level = DEBUG
level = INFO
qualname = myThreads
propagate = 0
......@@ -89,12 +89,12 @@ args=('botSim.log', 'w',)
[handler_beliefFileHandler]
class=logging.FileHandler
formatter=dataFormatter
args=('botSim_beliefs.log', 'w')
args=('botSim_beliefs.log', 'a')
[handler_evidenceFileHandler]
class=logging.FileHandler
formatter=dataFormatter
args=('botSim_evidence.log', 'w')
args=('botSim_evidence.log', 'a')
[formatter_defaultFormatter]
format="%(asctime)s [%(levelname)s] (%(threadName)-10s) %(name)s: %(message)s"
......
......@@ -507,7 +507,7 @@ class EPuckSim(object):
# Renormalise the small float errors to make sure belief is
# equal to 1.
newBelief /= newBelief.sum()
self._belief = newBelief
self._belief = round(newBelief, 15)
logger.debug('New belief is now {0}'.format(self._belief))
......
......@@ -47,7 +47,7 @@ class ControllerThread(threading.Thread):
self._stop_event.wait()
def run(self):
logger.debug('ControllerThread is starting.')
logger.info('ControllerThread is starting.')
retFlag = False
timestep = 0
try:
......@@ -64,7 +64,7 @@ class ControllerThread(threading.Thread):
timestep += 1
time.sleep(5)
self.ePuck.cleanUp()
logger.debug('ControllerThread has stopped')
logger.info('ControllerThread has stopped')
except BaseException as exc:
print('reraising Exception {}'.format(exc))
raise typeof(exc)(str(exc))
......
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