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