1 from operationscore.Behavior import *
3 """Expand is a behavior that generates a response that grows horizontally starting a location
4 specifed in input. Required Args:
5 <ExpandRate>123</ExpandRate> which is the expandrate in units/response"""
6
8 ret = []
9 for data in sensorInputs:
10 if not 'Left' in data:
11 data['Left'] = data['Location'][0]
12 data['Right'] = data['Location'][0]
13 data['ExpandRate'] = self['ExpandRate']
14
15 data = dict(data)
16 data['Left'] -= data['ExpandRate']
17 data['Right'] += data['ExpandRate']
18 data['Location'] = "{x}>" + str(data['Left']) + ", {x}<" +\
19 str(data['Right'])+", {y}<50"
20 ret.append(data)
21 return (ret, [])
22