Commit 048e88bf authored by Chanelle Lee's avatar Chanelle Lee
Browse files

Fixed a bug where if the controller for one of the robots failed then the...

Fixed a bug where if the controller for one of the robots failed then the others would continue and become stuck at pooling as not enough neighbours. Added a check that all the controller threads are alive and if not it stops the current simulations and kills all alive controller threads. Simulation pass over from one to the next successfully, now just waiting to see if it copes with failures as planned
parent 56e29ffe
......@@ -28,7 +28,7 @@ def main(numSims=10):
vrep.simx_opmode_blocking)
testParams = pd.read_csv('testParams.csv', index_col='paramSet')
for paramNum in set(testParams.index.values):
if paramNum < 6: # This just allows us to skip ones already tested
if paramNum < 8: # This just allows us to skip ones already tested
continue
print('Param num: {}'.format(paramNum))
simNum = 0
......@@ -63,8 +63,11 @@ def main(numSims=10):
testParams.iloc[paramNum-1]['sigma'],
testParams.iloc[paramNum-1]['alpha'])
try:
while any([p.isAlive() for p in controllerJobs]):
while all([p.isAlive() for p in controllerJobs]):
time.sleep(1)
for p in controllerJobs:
if not p.isAlive():
p.stop()
except BaseException as exc:
print('exception "{}" occurred'.format(type(exc)))
sys.exit(1)
......
......@@ -11,5 +11,7 @@ Experiments:
- _0 logs contain paramsets 1-5 complete
- Paramset 7 is not complete, only has sim runs 1-3
Analysis:
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