aboutsummaryrefslogtreecommitdiff
path: root/behaviors
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-02-16 15:26:29 -0500
committerGravatar rcoh <rcoh@mit.edu>2011-02-16 15:26:29 -0500
commit3c405fa182b1e524f5724e65266667d8f65dc179 (patch)
tree2e1320d152f4ae8579eb8f651be0af12da25c6cb /behaviors
parentd8ba03006e2ea1400e80caded738e79c186e8de3 (diff)
parentf34e1c732036553e4a68534dfc1b24a13ccd33ce (diff)
Merge branch 'master' into behavior-factory
Diffstat (limited to 'behaviors')
-rw-r--r--behaviors/Square.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/behaviors/Square.py b/behaviors/Square.py
index 9d3223a..5fdaeef 100644
--- a/behaviors/Square.py
+++ b/behaviors/Square.py
@@ -7,6 +7,7 @@ class Square(Behavior):
def processResponse(self, sensorInputs, recursiveInputs):
for sensory in sensorInputs:#TODO: consider replicating the dict
+ sensory['CenterLoc'] = list(sensory['Location'])
xLoc = sensory['Location'][0]
yLoc = sensory['Location'][1]
width = self['Width']
@@ -15,3 +16,9 @@ class Square(Behavior):
'{x}<'+str(xLoc+width)+',{x}>'+str(xLoc-width)+\
',{y}<'+str(yLoc+width)+',{y}>'+str(yLoc-width)
return (sensorInputs, recursiveInputs)
+
+ def setLastOutput(self, output):
+ coutput = Behavior.deepCopyPacket(output)
+ for data in coutput:
+ data['Location'] = data['CenterLoc']
+ return coutput