aboutsummaryrefslogtreecommitdiff
path: root/operationscore
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2010-12-01 19:46:14 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2010-12-01 19:46:14 -0500
commit0366f46d3d7e946e254f933888aea4beb4e70658 (patch)
tree81e69d857c41d9ff6ab0ee49315c26cd6112f3a9 /operationscore
parentcf1f2224b3625b01a6aa7db221403849b308b3bc (diff)
Added support for RecursiveHooks, RecursiveBehaviors and GaussianMapper
supporting Gaussian based pixel mapping.
Diffstat (limited to 'operationscore')
-rw-r--r--operationscore/Behavior.py1
-rw-r--r--operationscore/SmootCoreObject.py10
2 files changed, 9 insertions, 2 deletions
diff --git a/operationscore/Behavior.py b/operationscore/Behavior.py
index 8db2d88..e300f6b 100644
--- a/operationscore/Behavior.py
+++ b/operationscore/Behavior.py
@@ -37,7 +37,6 @@ class Behavior(SmootCoreObject):
except:
return (self.processResponse(sensorInputs, recursiveInputs),[])
def addInputs(self, sensorInputs):
- print sensorInputs
if type(sensorInputs) == type([]):
[self.addInput(sensorInput) for sensorInput in sensorInputs]
else:
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index 2901ef6..84319af 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -3,9 +3,14 @@ import pdb
class SmootCoreObject:
def __init__(self, argDict):
self.argDict = argDict
+ self.validateArgs(self.className()+'.params')
self.init() #call init of inheriting class
+ # self.__setitem__ = self.argDict.__setitem__
+ # self.__getitem__ = self.argDict.__getitem__
def init(self):
pass
+ def className(self):
+ return str(self.__class__).split('.')[-1]
def __setitem__(self,k, item):
self.argDict[k] = item
def __getitem__(self, item):
@@ -16,7 +21,10 @@ class SmootCoreObject:
def __getiter__(self):
return self.argDict.__getiter__()
def validateArgs(self, argFileName):
- self.validateArgDict(Util.loadParamRequirementDict(argFileName))
+ try:
+ self.validateArgDict(Util.loadParamRequirementDict(argFileName))
+ except IOError:
+ print 'No Arg Dict found for ' + self.className()
def validateArgDict(self, validationDict):
for item in validationDict:
if not item in self.argDict: