How to use the formulas.Temperature 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 / coderackPressure.py View on Github external
def calculatePressures(self):
        scale = (100.0 - Temperature + 10.0) / 15.0
        values = map(
            lambda pressure: sum(c.urgency ** scale for c in pressure.codelets),
            self.pressures
        )
        totalValue = sum(values) or 1.0
        values = [value / totalValue for value in values]
        self.maxValue = max(values)
        for pressure, value in zip(self.pressures, values):
            pressure.values += [value * 100.0]
        for codelet in self.removedCodelets:
            if codelet.pressure:
                codelet.pressure.codelets.remove(codelet)
        self.removedCodelets = []