def strategy(self, opponent):

        self.grumpiness = opponent.defections - opponent.cooperations

        if self.state == 'Nice':
            if self.grumpiness > self.grumpy_threshold:
                self.state = 'Grumpy'
                return D
            return C

        if self.state == 'Grumpy':
            if self.grumpiness < self.nice_threshold:
                self.state = 'Nice'
                return C
            return D
Run flood detection with a named algorithm in a given domain.
dataset/ETHPy150Open Axelrod-Python/Axelrod/axelrod/strategies/grumpy.py/Grumpy.strategy--crossover with--dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/modis/flood_algorithms.py/detect_flood