diff --git a/wolfsheep.py b/wolfsheep.py index 04f4705..ff8a831 100644 --- a/wolfsheep.py +++ b/wolfsheep.py @@ -32,12 +32,12 @@ class Simulator: for obj in state.right: nextStates.append( Model(state.left | set([Model.Man, obj]) , state.right - set([Model.Man,obj]) ) ) - nextStates = list(filter( + nextStates = filter( lambda s: not( s in stack or any([ any([ invalid_state <= m for invalid_state in Simulator.invalid_states ]) and Model.Man not in m for m in [s.left,s.right] ]) ) - , nextStates)) #Remove invalid and previous states. + , nextStates) #Remove invalid and previous states. for s in nextStates: m = self.simulate(s,stack)