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