Package 

Class Time

  • All Implemented Interfaces:

    
    public final class Time
    
                        
    • Constructor Detail

    • Method Detail

      • applyWhile

         final static <T extends Any> T applyWhile(Boolean event, Function1<Unit, T> f, T null)

        Apply a function while condition is true.

        Parameters:
        event - event
        f - function to be applied
        null - null value
      • cyclicFunction

         final static <T extends Any> T cyclicFunction(Number length, Function1<Unit, T> f, T null)

        Periodically invoke a function.

        Parameters:
        length - timeout
        f - function to be invoked
        null - default value
      • cyclicFunctionWithDecay

         final static <T extends Any> T cyclicFunctionWithDecay(Number length, Number decay, Function1<Unit, T> f, T null)

        Periodically invoke a function.

        Parameters:
        length - timeout
        decay - decay rate
        f - function to be invoked
        null - default value
      • delta

         final static Number delta(Number signal)
        Parameters:
        signal - signal to be monitored
      • evaporation

         final static <T extends Any> <ERROR CLASS> evaporation(Number length, T info, Number decay)

        Evaporation pattern.

        Parameters:
        length - duration
        info - information
        decay - decay rate
      • isSignalStable

         final static <T extends Any> Boolean isSignalStable(T signal, Number time)
        Parameters:
        signal - signal to be monitored
        time - consider the signal stable after this time
      • isSignalStableWithDt

         final static <T extends Any> Boolean isSignalStableWithDt(T signal, Number time, Number dt)
        Parameters:
        signal - signal to be monitored
        time - consider the signal stable after this time
        dt - dt
      • isValueChanged

         final static <T extends Any> Boolean isValueChanged(T signal)
        Parameters:
        signal - value to be monitored
      • limitedMemory

         final static <T extends Any> T limitedMemory(T value, T null, Number timeout, Number dt)

        Hold value until a specified timeout.

        TODO: reconsider this function. When do we trigger the recording?

        Parameters:
        value - value to be stored
        null - default value
        timeout - hold the value for this amount of time
        dt - increase the time of this value
      • wait

         final static Boolean wait(Number timeout)
        Parameters:
        timeout - count down length
      • waitAndApply

         final static <T extends Any> T waitAndApply(Number timeout, Function1<Unit, T> f, T null)
        Parameters:
        timeout - timeut
        f - function to be applied
        null - null value