aboutsummaryrefslogtreecommitdiff
path: root/operationscore
diff options
context:
space:
mode:
Diffstat (limited to 'operationscore')
-rw-r--r--operationscore/Behavior.py6
-rw-r--r--operationscore/SmootCoreObject.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/operationscore/Behavior.py b/operationscore/Behavior.py
index 97fa020..7090a23 100644
--- a/operationscore/Behavior.py
+++ b/operationscore/Behavior.py
@@ -19,6 +19,7 @@ class Behavior(SmootCoreObject):
self.recursiveResponseQueue = []
self.sensorResponseQueue = []
self.outGoingQueue = []
+ self.lastState = None
self.behaviorInit()
def behaviorInit(self):
pass
@@ -44,7 +45,9 @@ class Behavior(SmootCoreObject):
def getLastOutput(self):
return self.lastState
def setLastOutput(self, output):
- """Override to modify state."""
+ """Override to modify state. For example: if you are using a behavior that does uses
+ strings for location specification, you will want to override this to point to a single
+ location. Make sure you keep lastState as a [] of {}. (List of dicts)"""
self.lastState = output
def addMapperToResponse(self, responses):
if self['Mapper'] != None:
@@ -61,5 +64,6 @@ class Behavior(SmootCoreObject):
self.recursiveResponseQueue)
self.sensorResponseQueue = []
self.recursiveResponseQueue = recursions
+ self.setLastOutput(outputs)
main_log.debug(self['Id'] + ' Ouputs ' + str(outputs))
return self.addMapperToResponse(outputs)
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index 51b84e3..6addb9c 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -40,6 +40,8 @@ class SmootCoreObject(object):
item = self.argDict[key]
if isinstance(item, types.FunctionType):
return item(self.argDict) #resolve the lambda function, if it exists
+ #elif isinstance(item, list): #if its a list of items
+ # pass #TODO: consider doing resolution of lambda funcs for items in lists
else:
return item
else: