Skip to content
rubae edited this page Oct 1, 2013 · 2 revisions

Basic functions are included used in the further classes:

def get_probability(A, B, p_type="cum"):
    /* Find the x-value in a given (cumulative) probability array B based on random value A. */
    return idx
def startstate(A):
    /* Get the startstate for the first simulation day at 4:00 AM. */
    return int(state)
def transition(A, B, T):
    /* Get the next occupancy state from current state B at time T for daytype A. */
    return int(newocc)
def duration(A, B, T):
    /* Get the duration of current state B at time T for daytype A. */
    return durat

Furthermore, short abbreviations-functions are defined for easier coding.

def rand( ):
    /* Short definition to return a random variable. */
    return random.random()

Clone this wiki locally