How to use the formulas.weightedAverage function in formulas

To help you get started, we’ve selected a few formulas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fargonauts / copycat / copycat / workspace.py View on Github external
def getUpdatedTemperature(self):
        self.assessTemperature()
        ruleWeakness = 100.0
        if self.rule:
            self.rule.updateStrength()
            ruleWeakness = 100.0 - self.rule.totalStrength
        values = ((self.totalUnhappiness, 0.8), (ruleWeakness, 0.2))
        return formulas.weightedAverage(values)