From cbdc42af021f898e82d3e78ce7c636d3fb5eece0 Mon Sep 17 00:00:00 2001 From: Russell Date: Mon, 10 Jan 2011 12:21:19 -0500 Subject: Some performance improvements. Faster evaluation of range-based queries with lambda expressions. Faster exp with approximated fastexp. Some changes to the component registry. --- pixelevents/DecayEvent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pixelevents/DecayEvent.py') diff --git a/pixelevents/DecayEvent.py b/pixelevents/DecayEvent.py index c1166d6..3767729 100644 --- a/pixelevents/DecayEvent.py +++ b/pixelevents/DecayEvent.py @@ -1,6 +1,7 @@ from operationscore.PixelEvent import * import math from util.ColorOps import * +import util.Geo as Geo class DecayEvent(PixelEvent): def initEvent(self): self.coefficient = float(abs(self['Coefficient'])) @@ -13,7 +14,7 @@ class DecayEvent(PixelEvent): #SUBVERTING DESIGN FOR THE SAKE OF EFFICIENCY -- RUSSELL COHEN (2011-01-03-23:18) def state(self,timeDelay): if self.decayType == 1: - decay = math.exp(timeDelay*-1*self.coefficient) + decay = Geo.approxexp(timeDelay*-1*self.coefficient) if self.decayType == 2: decay = self.coefficient / timeDelay color = multiplyColor(self.color, decay) -- cgit v1.2.3