(ramp_option, T, wp_final_multiplier=1.0)
return wpm
Return a time-varying multiplier.
    Returns:
        A (T,) float vector containing weights for each time step.
Return a time-varying multiplier.
    Returns:
        A (T,) float vector containing weights for each time step.
Return a time - varying multiplier . Returns : A ( T ) float vector containing weights for each time step .
def get_ramp_multiplier(ramp_option, T, wp_final_multiplier=1.0):
    """
    Return a time-varying multiplier.
    Returns:
        A (T,) float vector containing weights for each time step.
    """
    if ramp_option == RAMP_CONSTANT:
        wpm = np.ones(T)
    elif ramp_option == RAMP_LINEAR:
        wpm = (np.arange(T, dtype=np.float32) + 1) / T
    elif ramp_option == RAMP_QUADRATIC:
        wpm = ((np.arange(T, dtype=np.float32) + 1) / T) ** 2
    elif ramp_option == RAMP_FINAL_ONLY:
        wpm = np.zeros(T)
        wpm[T-1] = 1.0
    else:
        raise ValueError('Unknown cost ramp requested!')
    wpm[-1] *= wp_final_multiplier
    return wpm
def get_ramp_multiplier ( ramp_option , T , wp_final_multiplier = 1.0 ) : if ramp_option == RAMP_CONSTANT : wpm = np . ones ( T ) elif ramp_option == RAMP_LINEAR : wpm = ( np . arange ( T , dtype = np . float32 ) + 1 ) / T elif ramp_option == RAMP_QUADRATIC : wpm = ( ( np . arange ( T , dtype = np . float32 ) + 1 ) / T ) ** 2 elif ramp_option == RAMP_FINAL_ONLY : wpm = np . zeros ( T ) wpm [ T - 1 ] = 1.0 else : raise ValueError ( 'Unknown cost ramp requested!' ) wpm [ - 1 ] *= wp_final_multiplier return wpm