From 5e2981624c61cfd7d7aaa635531298cba3edd8e2 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Wed, 29 Apr 2015 07:03:53 +0200 Subject: [PATCH] Wolfsheep improved #2 --- wolfsheep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)