aboutsummaryrefslogtreecommitdiff
path: root/operationscore
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2010-12-03 04:20:17 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2010-12-03 04:20:17 -0500
commit353ab16db64c86122c0fcb9e1852b85c14b354b8 (patch)
tree8904f1cd312974a849ad5bcf0c8520fd20175cda /operationscore
parent0366f46d3d7e946e254f933888aea4beb4e70658 (diff)
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.
Diffstat (limited to 'operationscore')
-rw-r--r--operationscore/Behavior.py3
-rw-r--r--operationscore/Input.py3
-rw-r--r--operationscore/SmootCoreObject.py6
3 files changed, 7 insertions, 5 deletions
diff --git a/operationscore/Behavior.py b/operationscore/Behavior.py
index e300f6b..83d2e7d 100644
--- a/operationscore/Behavior.py
+++ b/operationscore/Behavior.py
@@ -56,5 +56,6 @@ class Behavior(SmootCoreObject):
try:
return outputs
except:
- pdb.set_trace()
+ pass
+ #pdb.set_trace()
return outputs
diff --git a/operationscore/Input.py b/operationscore/Input.py
index 67a7bb0..9ee59f8 100644
--- a/operationscore/Input.py
+++ b/operationscore/Input.py
@@ -32,7 +32,10 @@ class Input(threading.Thread):
def respond(self, eventDict):
#if eventDict != []:
#pdb.set_trace()
+ self.parentScope.lock.acquire()
self.parentScope.processResponse(self.argDict, eventDict)
+ self.parentScope.lock.release()
+ time.sleep(.001)
def newEvent(self, event): #Mostly just useful for grabbing events from the
#computer running the sim (key presses, clicks etc.)
self.eventQueue.append(event)
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index 84319af..d29e710 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -21,10 +21,8 @@ class SmootCoreObject:
def __getiter__(self):
return self.argDict.__getiter__()
def validateArgs(self, argFileName):
- try:
- self.validateArgDict(Util.loadParamRequirementDict(argFileName))
- except IOError:
- print 'No Arg Dict found for ' + self.className()
+ self.validateArgDict(Util.loadParamRequirementDict(argFileName))#util
+ #caches for us, woo!
def validateArgDict(self, validationDict):
for item in validationDict:
if not item in self.argDict: