Skip to content

Commit

Permalink
Fix strategy generation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
samueljero committed Mar 25, 2016
1 parent ae2fb82 commit 5c4f3c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions coordinator/strategies.py
Expand Up @@ -91,11 +91,14 @@ def strategy_feedback(self, strat, feedback, result = None):
st['priority'] = priority
if strat is not None:
#New message under this strategy
tmp = strat
tmp = dict(strat)
tmp['switch'] = strat['switch'] + switch_strat
if len(tmp['switch'] > 2):
if not isinstance(tmp['switch'],dict) or not isinstance(tmp['switch'],list) or len(tmp['switch'] > 2):
print "Warning. Possible runaway strategy"
print str(tmp)
self.lg.write("Warning. Possible runaway strategy\n")
self.lg.write(str(tmp)+"\n")
self.lg.flush()
else:
self.strat_lst.append(tmp)
else:
Expand Down

0 comments on commit 5c4f3c0

Please sign in to comment.