aboutsummaryrefslogtreecommitdiff
path: root/behaviors/RecursiveDecay.py
blob: 218813de8a9e032fd34f4f8f2e18847469d60854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from operationscore.Behavior import *
import pdb
class RecursiveDecay(Behavior):
    def processResponse(self, sensorInputs, recursiveInputs):
        ret = []
        for response in sensorInputs:
            if not 'ResponsesLeft' in response:
                response['ResponsesLeft'] = self['InitialResponseCount']
            else:
                response['ResponsesLeft'] -= 1
            if response['ResponsesLeft'] > 0:
                ret.append(response)
        return (ret, []) #no direct ouput