sysdynpy/simulator.py
def _calculate_stock_change(self, stock):
        """Calculates the change for a given stock based on the calculation rule.

        This method only checks the input- and output flows of the stock. It presumes
        that values for these flows have already been calculated for the current
        simulation step.

        :param stock: The stock to calculate the change for.
        :type stock: Stock
        :return: The calculated value
        :rtype: float
        """
        calc_rule = stock.calc_rule

        temp_dict = {}
        for inp_elem in stock.input_elements:
                temp_dict[inp_elem.var_name] = inp_elem.value
        
        for key in temp_dict:
            calc_rule.__globals__[key] = temp_dict[key]

        return calc_rule()
Calculates the change for a given stock based on the calculation rule.

        This method only checks the input- and output flows of the stock. It presumes
        that values for these flows have already been calculated for the current
        simulation step.

        :param stock: The stock to calculate the change for.
        :type stock: Stock
        :return: The calculated value
        :rtype: float
        
Calculates the change for a given stock based on the calculation rule.
This method only checks the input- and output flows of the stock. It presumes
that values for these flows have already been calculated for the current
simulation step.
Calculates the change for a given stock based on the calculation rule . This method only checks the input - and output flows of the stock . It presumes that values for these flows have already been calculated for the current simulation step .
def _calculate_stock_change(self, stock):
        calc_rule = stock.calc_rule
        temp_dict = {}
        for inp_elem in stock.input_elements:
                temp_dict[inp_elem.var_name] = inp_elem.value
        for key in temp_dict:
            calc_rule.__globals__[key] = temp_dict[key]
        return calc_rule()
def _calculate_stock_change ( self , stock ) : calc_rule = stock . calc_rule temp_dict = { } for inp_elem in stock . input_elements : temp_dict [ inp_elem . var_name ] = inp_elem . value for key in temp_dict : calc_rule . __globals__ [ key ] = temp_dict [ key ] return calc_rule ( )
Calculates the change for a given stock based on the calculation rule.
Calculates the change for a given stock based on the calculation rule .
"""Calculates the change for a given stock based on the calculation rule.

        This method only checks the input- and output flows of the stock. It presumes
        that values for these flows have already been calculated for the current
        simulation step.

        :param stock: The stock to calculate the change for.
        :type stock: Stock
        :return: The calculated value
        :rtype: float
        """
The calculated value
The calculated value
float
self
stock
The stock to calculate the change for.
The stock to calculate the change for .