How to use the pysd.functions.cache function in pysd

To help you get started, we’ve selected a few pysd 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 SDXorg / test-models / tests / number_handling / test_number_handling.py View on Github external
@cache('step')
def equality():
    """
    equality




    """
    return functions.if_then_else(quotient() == quotient_target(), 1, 0)
github SDXorg / test-models / samples / teacup / teacup.py View on Github external
@cache('step')
def saveper():
    """
    SAVEPER

    Minute [0,?]

    The frequency with which output is stored.
    """
    return time_step()
github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
@cache('step')
def saveper():
    """
    SAVEPER

    Minute [0,?]

    The frequency with which output is stored.
    """
    return time_step()
github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
@cache('run')
def initial_time():
    """
    INITIAL TIME

    Minute

    The initial time for the simulation.
    """
    return 0
github SDXorg / test-models / tests / number_handling / test_number_handling.py View on Github external
@cache('step')
def saveper():
    """
    SAVEPER

    Month [0,?]

    The frequency with which output is stored.
    """
    return time_step()
github SDXorg / test-models / samples / teacup / teacup.py View on Github external
@cache('run')
def room_temperature():
    """
    Room Temperature




    """
    return 70
github SDXorg / test-models / tests / number_handling / test_number_handling.py View on Github external
@cache('run')
def quotient_target():
    """
    quotient target




    """
    return 0.75
github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
@cache('run')
def final_time():
    """
    FINAL TIME

    Minute

    The final time for the simulation.
    """
    return 45
github SDXorg / test-models / tests / number_handling / test_number_handling.py View on Github external
@cache('step')
def quotient():
    """
    quotient




    """
    return numerator() / denominator()
github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
@cache('step')
def accumulation():
    """
    accumulation




    """
    return integ_accumulation()