aboutsummaryrefslogtreecommitdiff
path: root/behaviors/Square.py
blob: aef362285615166307d98e1ba19f02a0753d36be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from operationscore.Behavior import *
class Square(Behavior):
        def processResponse(self, sensorInputs, recursiveInputs):
            for sensory in sensorInputs:#TODO: consider replicating the dict
                xLoc = sensory['Location'][0]
                yLoc = sensory['Location'][1]
                width = self['Width']
                #sensory['Location'] = 'True'
                sensory['Location'] =\
                    '{x}<'+str(xLoc+width)+',{x}>'+str(xLoc-width)+\
                    ',{y}<'+str(yLoc+width)+',{y}>'+str(yLoc-width)
            return (sensorInputs, recursiveInputs)