From 353ab16db64c86122c0fcb9e1852b85c14b354b8 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Fri, 3 Dec 2010 04:20:17 -0500 Subject: Speed optimizations abound! Caching on parameter validation, Binary searching for light locations in pixel mappers, actual thread safety for inputs means we don't drop them randomly, anymore. Caching on PixelStates to reduce multi-renderer costs + a short circuit to speed up processing on pixels that are turned off. --- behaviors/ColorChangerBehavior.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'behaviors') diff --git a/behaviors/ColorChangerBehavior.py b/behaviors/ColorChangerBehavior.py index ca80eb4..12ef6f4 100644 --- a/behaviors/ColorChangerBehavior.py +++ b/behaviors/ColorChangerBehavior.py @@ -7,8 +7,8 @@ class ColorChangerBehavior(Behavior): for sensory in sensorInputs: newDict = dict(sensory) #don't run into shallow copy issues if self['ColorList'] != None: - newDict['Color'] = Util.randomColor(self['ColorList']) + newDict['Color'] = Util.chooseRandomColor(self['ColorList']) else: - newDict['Color'] = Util.chooseRandomColor() + newDict['Color'] = Util.randomColor() ret.append(newDict) return ret -- cgit v1.2.3