aboutsummaryrefslogtreecommitdiff
path: root/behaviors/Square.py
blob: ecd000c9196d8769c87710f392af02f1e27bbe2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from operationscore.Behavior import *
class Square(Behavior):
        def processResponse(self, sensorInputs, recursiveInputs):
            for sensory in sensorInputs:#TODO: consider replicating the dict
                if 'Location' in sensory:
		        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)