Package 

Class spreadingKt

    • Method Detail

      • boundBroadcast

         final <T extends Any> T boundBroadcast(Boolean region, T null, Boolean source, Object value)

        Constrain the spreading of broadcast function only within a region.

        Parameters:
        region - whether the function is spreaded or not
        null - default value where f is not spreaded
        source - whether the current device is a source
      • boundG

         final <T extends Any> T boundG(Boolean region, T null, Boolean source, T initial, Function1<Unit, Number> metric, Function1<T, T> accumulate)

        Constrain the spreading of G function only within a region.

        Parameters:
        region - whether the function is spreaded or not
        null - default value where f is not spreaded
        source - whether the current device is a source
        initial - initial value of the computation
        metric - estimate distance from other devices
        accumulate - how to manage the value
      • channel

         final Boolean channel(Boolean source, Boolean dest, Number thr)

        Dynamically computes distributed routes between regions of a network, and dynamically adapts to shape and changes of the network topology. The channel is a Boolean field that is true for devices near the shortest route from a given (distributed) source to a (distributed) destination.

        Parameters:
        source - whether the device is a source
        dest - whether the device is a destination
        thr - threshold for Double comparison (e.g.
      • channelWithObstacle

         final Boolean channelWithObstacle(Boolean source, Boolean dest, Boolean obstacle, Number thr)

        Dynamically computes distributed routes between regions of a network, and dynamically adapts to shape and changes of the network topology. The channel is a Boolean field that is true for devices near the shortest route from a given (distributed) source to a (distributed) destination.

        Parameters:
        source - whether the device is a source
        dest - whether the device is a destination
        obstacle - whether the device is an obstacle
        thr - threshold for Double comparison (e.g.
      • channel2

         final Boolean channel2(Boolean source, Object destination, Number width)

        Channel pattern.

        Parameters:
        source - whether the device is a source
        width - how much to dilate the channel
      • channel2WithObstacle

         final Boolean channel2WithObstacle(Boolean source, Object destination, Boolean obstacle, Number width)

        Channel pattern.

        Parameters:
        source - whether the device is a source
        obstacle - whether the device is an obstacle
        width - how much to dilate the channel
      • crfGradient

         final Number crfGradient(Boolean source, Number maxHop)

        Self-healing gradient algorithm that reconfigures in O(diameter) time. Requires euclidean metric.

        Parameters:
        source - whether the device is a source
        maxHop - communication max range
      • crfGradientWithMetric

         final Number crfGradientWithMetric(Boolean source, Function1<Unit, Number> metric, Number maxHop)

        Self-healing gradient algorithm that reconfigures in O(diameter) time. Requires euclidean metric.

        Parameters:
        source - whether the device is a source
        metric - how to estimate distances without lag
        maxHop - communication max range
      • bisGradient

         final Number bisGradient(Boolean source, Number radius, Number speed)

        Self-healing gradient algorithm with single-path reaction speed.

        Parameters:
        source - whether the device is a source
        radius - communication max range
        speed - estimate of single-path speed
      • bisGradientWithMetric

         final Number bisGradientWithMetric(Boolean source, Function1<Unit, Number> metric, Number radius, Number speed)

        Self-healing gradient algorithm with single-path reaction speed.

        Parameters:
        source - whether the device is a source
        metric - how to estimate distances without lag
        radius - communication max range
        speed - estimate of single-path speed
      • dilate

         final Boolean dilate(Boolean region, Number width)

        Dilate a spatial region.

        Parameters:
        region - whether the device is inside the region
        width - how much to dilate
      • dilateWithMetric

         final Boolean dilateWithMetric(Boolean region, Function1<Unit, Number> metric, Number width)

        Dilate a spatial region.

        Parameters:
        region - whether the device is inside the region
        metric - how to estimate the distance between devices
        width - how much to dilate
      • directProjection

         final Boolean directProjection(Boolean source, Boolean obstacle)

        Forecast obstacles along a path to the source.

        Parameters:
        source - whether the device is a source
        obstacle - whether the device is an obstacle
      • directProjectionWithMetric

         final Boolean directProjectionWithMetric(Boolean source, Boolean obstacle, Function1<Unit, Number> metric)

        Forecast obstacles along a path to the source.

        Parameters:
        source - whether the device is a source
        obstacle - whether the device is an obstacle
        metric - how to estimate neighbors distances
      • distanceBetween

         final Number distanceBetween(Boolean source, Boolean dest)

        Smallest distance between source and destination devices.

        Parameters:
        source - whether the current device is a source
        dest - whether the current device is a destination
      • distanceBetweenWithMetric

         final Number distanceBetweenWithMetric(Boolean source, Boolean dest, Function1<Unit, Number> metric)

        Smallest distance between source and destination devices.

        Parameters:
        source - whether the current device is a source
        dest - whether the current device is a destination
        metric - estimate distance from other devices
      • roundTripTime

         final Unit roundTripTime(Number d)

        Estimate worst propagation time considering a message round trip.

        Parameters:
        d - network diameter
      • flexGradient

         final Unit flexGradient(Boolean source, Number epsilon, Number rate, Number range, Number distortion)

        Flex-Gradient.

        Parameters:
        source - whether the device is a source
        epsilon - tolerance
        rate - communication rate
        range - communication range
        distortion - distortion
      • flexGradientWithMetric

         final Unit flexGradientWithMetric(Boolean source, Number epsilon, Number rate, Number range, Number distortion, Function1<Unit, Number> metric)

        Flex-Gradient.

        Parameters:
        source - whether the device is a source
        epsilon - tolerance
        rate - communication rate
        range - communication range
        distortion - distortion
        metric - estimate distance from other devices
      • Gnull

         final <T extends Any> T Gnull(T v, T default)

        Wrapper for G error. For example: G(aBool, aBool, aMetric, (v) -> { Gnull(v, false) ... } assure that G is not broken in case minHood(..., ...) returns Infinity.

        Parameters:
        v - value to be checked
        default - default value to avoid to broke G
      • gradcast

         final <T extends Any> T gradcast(Boolean source, T local, Number gradient, Function1<T, T> accumulate)

        Gradcast.

        Parameters:
        source - whether the device is a source
        local - local value
        gradient - gradient to follow
        accumulate - how to accumulate local values
      • gradient

         final <T extends Any> <ERROR CLASS> gradient(Boolean source, T init, Function1<Unit, Number> metric, Function1<T, T> accumulate)

        Spread and extend information with distance from the source region.

        Parameters:
        source - whether the current device is a source
        init - initial value of the computation
        metric - estimate distance from other devices
        accumulate - how to accumulate the value
      • descend

         final Boolean descend(Boolean source, Number potential)

        Shortest path according to a potential.

        Parameters:
        source - whether the device is a source
        potential - potential
      • rendezvous

         final Boolean rendezvous(Boolean source, Boolean dest)

        Shortest path.

        Parameters:
        source - whether the device is the source
        dest - whether the device is the destination
      • shortestPath

         final Boolean shortestPath(Boolean source, Object destination)

        Dynamically computes the shortest route between regions of a network, and dynamically adapts to shape and changes of the network topology. The shortest path is a Boolean field that is true for devices near the shortest route from a given (distributed) source to a (distributed) destination.

        Parameters:
        source - whether the device is the source
      • vm

         final <T extends Any> T vm(Boolean source, Number range, Function1<Unit, T> f, T null)

        Entry point for a computation.

        Parameters:
        source - whether the device is a source
        range - spreading constraint
        f - entry point
        null - default value
      • vmWithMetric

         final <T extends Any> T vmWithMetric(Boolean source, Function1<Unit, Number> metric, Number range, Function1<Unit, T> f, T null)

        Entry point for a computation.

        Parameters:
        source - whether the device is a source
        metric - how to estimate neighbors distances
        range - spreading constraint
        f - entry point
        null - default value
      • voronoiPatitioning

         final <T extends Any> T voronoiPatitioning(Boolean source, T id)

        Computing a Voronoi partition is an operation that is frequently useful in distributed systems. Given an initial set of seed devices, a Voronoi partition assigns each device to the partition of the nearest seed, effectively breaking the network up into zones of influence around key elements.

        Parameters:
        source - whether the device is a seed
        id - partition id
      • voronoiPatitioningWithMetric

         final <T extends Any> T voronoiPatitioningWithMetric(Object seed, T id, Function1<Unit, Number> metric)

        Computing a Voronoi partition is an operation that is frequently useful in distributed systems. Given an initial set of seed devices, a Voronoi partition assigns each device to the partition of the nearest seed, effectively breaking the network up into zones of influence around key elements.

        Parameters:
        id - partition id
        metric - how to estimate the distances of the neighbors