Trait

it.unibo.scafi.lib.StdLib_BuildingBlocks

BuildingBlocks

Related Doc: package StdLib_BuildingBlocks

Permalink

trait BuildingBlocks extends (StdLib_BuildingBlocks.this)#Gradients with (StdLib_BuildingBlocks.this)#FieldUtils with (StdLib_BuildingBlocks.this)#BlockG with (StdLib_BuildingBlocks.this)#BlockC with (StdLib_BuildingBlocks.this)#BlockS with (StdLib_BuildingBlocks.this)#BlockT with (StdLib_BuildingBlocks.this)#TimeUtils with (StdLib_BuildingBlocks.this)#BlocksWithGC with (StdLib_BuildingBlocks.this)#StateManagement

Self Type
(StdLib_BuildingBlocks.this)#BuildingBlocks with (StdLib_BuildingBlocks.this)#FieldCalculusSyntax with (StdLib_BuildingBlocks.this)#StandardSensors
Linear Supertypes
(StdLib_BuildingBlocks.this)#BlocksWithGC, (StdLib_BuildingBlocks.this)#TimeUtils, (StdLib_BuildingBlocks.this)#BlockT, (StdLib_BuildingBlocks.this)#BlockS, (StdLib_BuildingBlocks.this)#BlockC, (StdLib_BuildingBlocks.this)#BlockG, (StdLib_BuildingBlocks.this)#FieldUtils, (StdLib_BuildingBlocks.this)#Gradients, (StdLib_BuildingBlocks.this)#StateManagement, (StdLib_BuildingBlocks.this)#GenericUtils, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BuildingBlocks
  2. BlocksWithGC
  3. TimeUtils
  4. BlockT
  5. BlockS
  6. BlockC
  7. BlockG
  8. FieldUtils
  9. Gradients
  10. StateManagement
  11. GenericUtils
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait FieldOps extends AnyRef

    Permalink
    Definition Classes
    FieldUtils
  2. case class Gradient(algorithm: (Boolean, () ⇒ Double) ⇒ Double, source: Boolean = false, metric: (StdLib_Gradients.this)#Metric = nbrRange) extends Product with Serializable

    Permalink
    Definition Classes
    Gradients

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def BisGradient(commRadius: Double = 0.2, lagMetric: ⇒ Double = nbrLag().toMillis): (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  5. def C[P, V](potential: P, acc: (V, V) ⇒ V, local: V, Null: V)(implicit arg0: Bounded[P]): V

    Permalink

    Collects values down a potential field.

    Collects values down a potential field.

    P

    type of the potential field

    V

    type of the values to be collected/accumulated

    potential

    the field providing the direction of the collection process

    acc

    the function describing how values are to be collected

    local

    the value field providing the value to be collected for each device

    Null

    zero value for accumulation and for neighbours for which the current device is *not* a parent in the field

    returns

    the accumulation value for each device according to its position in the potential field

    Definition Classes
    BlockC
  6. val ClassicGradient: (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  7. val ClassicHopGradient: (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  8. def CrfGradient(raisingSpeed: Double = 5, lagMetric: ⇒ Double = nbrLag().toMillis): (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  9. def FlexGradient(epsilon: Double = 0.5, delta: Double = 1.0, communicationRadius: Double = 1.0): (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  10. def G[V](source: Boolean, field: V, acc: (V) ⇒ V, metric: () ⇒ Double): V

    Permalink
    Definition Classes
    BlockG
  11. def Gcurried[V](source: Boolean)(field: V)(acc: (V) ⇒ V)(metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): V

    Permalink

    Curried version of G

    Curried version of G

    Definition Classes
    BlockG
  12. def S(grain: Double, metric: (StdLib_BuildingBlocks.this)#Metric): Boolean

    Permalink
    Definition Classes
    BlockS
  13. def S2(grain: Double): Boolean

    Permalink
    Definition Classes
    BlockS
  14. def SvdGradient(lagMetric: ⇒ Double = nbrLag().toMillis): (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  15. def T[V](initial: V, dt: V)(implicit ev: Numeric[V]): V

    Permalink
    Definition Classes
    BlockT
  16. def T[V](initial: V)(implicit ev: Numeric[V]): V

    Permalink
    Definition Classes
    BlockT
  17. def T[V](initial: V, decay: (V) ⇒ V)(implicit ev: Numeric[V]): V

    Permalink
    Definition Classes
    BlockT
  18. def T[V](initial: V, floor: V, decay: (V) ⇒ V)(implicit ev: Numeric[V]): V

    Permalink
    Definition Classes
    BlockT
  19. def UltGradient(radius: Double = 0.2, factor: Double = 0.1): (BuildingBlocks.this)#Gradient

    Permalink
    Definition Classes
    Gradients
  20. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  21. def average(sink: Boolean, value: Double): Double

    Permalink
    Definition Classes
    BlocksWithGC
  22. def bisGradient(commRadius: Double = 0.2, lagMetric: ⇒ Double = nbrLag().toMillis)(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink
    Definition Classes
    Gradients
  23. def breakUsingUids(uid: (Double, (StdLib_BuildingBlocks.this)#ID), grain: Double, metric: (StdLib_BuildingBlocks.this)#Metric): Boolean

    Permalink

    Breaks simmetry using UIDs.

    Breaks simmetry using UIDs. UIDs are used to break symmetry by a competition between devices for leadership.

    Definition Classes
    BlockS
  24. def broadcast[V](source: Boolean, field: V, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): V

    Permalink

    Broadcast information outward from a source field.

    Broadcast information outward from a source field.

    V

    Type of the value to be broadcast

    source

    The source of the broadcast

    field

    Field denoting (1) at the source, the value to be broadcast; and (2) in other places, the default value of the broadcast field.

    metric

    Metric that parameterises the gradient-based construction of the the propagation structure

    returns

    A broadcast field.

    Definition Classes
    BlockG
  25. def captureChange[T](x: T, initially: Boolean = true): Boolean

    Permalink

    returns

    true only when a discontinuity (i.e., a change) is observed on x (you may choose how to handle the first observation)

    Definition Classes
    StateManagement
  26. def channel(source: Boolean, target: Boolean, width: Double): Boolean

    Permalink

    A channel from a source to a target with width width.

    A channel from a source to a target with width width. A channel is a boolean field which is true in correspondence of the device positioned along the minimum path from source to target.

    Definition Classes
    BlockG
  27. def classicGradient(source: Boolean, metric: () ⇒ Double = nbrRange): Double

    Permalink
    Definition Classes
    Gradients
  28. def clock[T](length: T, decay: T)(implicit ev: Numeric[T]): Long

    Permalink
    Definition Classes
    BlockT
  29. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  30. def collectCount(alongPotentialField: Double, predicate: Boolean): Long

    Permalink

    returns

    the collection of the number of devices for which predicate is true

    Definition Classes
    BlockC
  31. def collectIntoSet[T](downTo: Double, local: T): Set[T]

    Permalink

    Collects a set by merging values

    Collects a set by merging values

    Definition Classes
    BlockC
  32. def collectMaps[K, V](downTo: Double, local: Map[K, V], merge: (K, V, V) ⇒ V = (k: K, v1: V, v2: V) => v1): Map[K, V]

    Permalink

    Collects a map by merging map entries

    Collects a map by merging map entries

    downTo

    potential field

    local

    maps to be merged

    merge

    function specifying how to merge entries with the same key

    returns

    the collect field of the merged maps

    Definition Classes
    BlockC
  33. def collectMean(alongPotentialField: Double, value: Double): Double

    Permalink

    returns

    the collect field of the mean of the value field

    Definition Classes
    BlockC
  34. def collectSets[T](downTo: Double, local: Set[T]): Set[T]

    Permalink

    Collects a set by merging sets

    Collects a set by merging sets

    Definition Classes
    BlockC
  35. def collectValuesByDevices[T](downTo: Double, local: T): Map[(StdLib_BuildingBlocks.this)#ID, T]

    Permalink

    Collects values as a map by preserving the sources of those values

    Collects values as a map by preserving the sources of those values

    Definition Classes
    BlockC
  36. def constant[T](value: ⇒ T): T

    Permalink

    Alias for remember()

    Alias for remember()

    Definition Classes
    StateManagement
  37. def countChanges[T](x: T, initially: Boolean = true): (Long, Boolean)

    Permalink
    Definition Classes
    StateManagement
  38. def crfGradient(raisingSpeed: Double = 5, lagMetric: ⇒ Double = nbrLag().toMillis)(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink
    Definition Classes
    Gradients
  39. def cyclicFunction[T](length: FiniteDuration, f: () ⇒ T, NULL: T): T

    Permalink

    Periodically invoke a function.

    Periodically invoke a function.

    length

    FiniteDuratrion, timeout

    f

    () -> T, function to be invoked

    NULL

    T, default value

    returns

    T, apply f if the timeout is expired, NULL otherwise

    Definition Classes
    TimeUtils
  40. def cyclicFunctionWithDecay[T, V](length: T, decay: T, f: () ⇒ V, NULL: V)(implicit ev: Numeric[T]): V

    Permalink

    Periodically invoke a function.

    Periodically invoke a function.

    length

    T, timeout

    decay

    T, decay rate

    f

    () -> V, function to be invoked

    NULL

    V, default value

    returns

    V, apply f if the timeout is expired, NULL otherwise

    Definition Classes
    TimeUtils
  41. def cyclicTimer[T](length: T)(implicit ev: Numeric[T]): Boolean

    Permalink

    Cyclic timer with a default unitary decay

    Cyclic timer with a default unitary decay

    length

    timeout

    returns

    true if the timeout is expired, false otherwise

    Definition Classes
    BlockT
  42. def cyclicTimerWithDecay[T](length: T, decay: T)(implicit ev: Numeric[T]): Boolean

    Permalink

    Cyclic timer.

    Cyclic timer.

    length

    timeout

    decay

    decay rate

    returns

    true if the timeout is expired, false otherwise

    Definition Classes
    BlockT
  43. def delay[T](value: T): T

    Permalink

    It is a simple building block which returns the same values it receives in input delayed by one computation round.

    It is a simple building block which returns the same values it receives in input delayed by one computation round.

    Definition Classes
    StateManagement
  44. def distanceBetween(source: Boolean, target: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink

    Distance between source to target based on metric

    Distance between source to target based on metric

    Definition Classes
    BlockG
  45. def distanceCompetition(d: Double, lead: (Double, (StdLib_BuildingBlocks.this)#ID), uid: (Double, (StdLib_BuildingBlocks.this)#ID), grain: Double, metric: (StdLib_BuildingBlocks.this)#Metric): (Double, (StdLib_BuildingBlocks.this)#ID)

    Permalink

    Candidate leader devices surrender leadership to the lowest nearby UID.

    Candidate leader devices surrender leadership to the lowest nearby UID.

    Definition Classes
    BlockS
  46. def distanceTo(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink

    A field of distance (i.e., a gradient) from a source, based on a given metric

    A field of distance (i.e., a gradient) from a source, based on a given metric

    Definition Classes
    BlockG
  47. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  48. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  49. def evaporation[T, V](length: T, info: V)(implicit ev: Numeric[T]): (T, V)

    Permalink

    Evaporation pattern.

    Evaporation pattern. Starting from [lenght, info] descends to [0, info] with a predefined unitary decay (The floor values depends on length's type)

    length

    T, duration

    info

    V, information

    returns

    [V, T]

    Definition Classes
    TimeUtils
  50. def evaporation[T, V](length: T, decay: (T) ⇒ T, info: V)(implicit ev: Numeric[T]): (T, V)

    Permalink

    Evaporation pattern.

    Evaporation pattern. Starting from [lenght, info] descends to [0, info] with a custom decay (The floor values depends on length's type)

    length

    T, duration

    decay

    T => T, decay rate

    info

    V, information

    returns

    [V, T]

    Definition Classes
    TimeUtils
  51. object excludingSelf extends (FieldUtils.this)#FieldOps

    Permalink
    Definition Classes
    FieldUtils
  52. def exponentialBackoffFilter[T](signal: T, a: T)(implicit ev: Numeric[T]): T

    Permalink

    Exponential back-off filter.

    Exponential back-off filter.

    signal

    T, signal to be filtered

    a

    T, alpha value

    returns

    T, filtered signal

    Definition Classes
    BlockT
  53. def findParent[V](potential: V)(implicit arg0: Bounded[V]): (StdLib_BuildingBlocks.this)#ID

    Permalink

    returns

    the ID of the "parent device" along a potential field, i.e., the neighbour with the smallest value of the potential field.

    Definition Classes
    BlockC
  54. def findParentOpt[V](potential: V)(implicit arg0: Bounded[V]): Option[(StdLib_BuildingBlocks.this)#ID]

    Permalink

    returns

    the parent device UID of the current device along field potential, or None if no such a parent is there (so that the device is parent of itself).

    Definition Classes
    BlockC
  55. def flexGradient(epsilon: Double = 0.5, delta: Double = 1.0, communicationRadius: Double = 1.0)(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink

    Idea: a device should change its estimate only for significant errors.

    Idea: a device should change its estimate only for significant errors. Useful when devices far from the source need only coarse estimates. Flex gradient provides tunable trade-off between precision and communication cost.

    epsilon

    Parameter expressing tolerance wrt changes

    delta

    Distortion into the distance measure, such that neighbor distance is never considered to be less than delta * communicationRadius.

    source

    Source fields of devices from which the gradient is calculated

    Definition Classes
    Gradients
  56. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  57. def goesDown(value: Boolean): Boolean

    Permalink

    returns

    true when the given parameter goes from true to false (starting from false); false otherwise

    Definition Classes
    StateManagement
  58. def goesUp(value: Boolean): Boolean

    Permalink

    returns

    true when the given parameter goes from false to true (starting from false); false otherwise

    Definition Classes
    StateManagement
  59. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  60. def hopDistance(source: Boolean): Double

    Permalink

    Hop distance

    Hop distance

    Definition Classes
    BlockG
  61. def hopGradient(source: Boolean): Double

    Permalink
    Definition Classes
    Gradients
  62. def impulsesEvery(d: FiniteDuration): Boolean

    Permalink
    Definition Classes
    TimeUtils
  63. def impulsesEvery[T](d: T)(implicit arg0: Numeric[T]): Boolean

    Permalink
    Definition Classes
    BlockT
  64. object includingSelf extends (FieldUtils.this)#FieldOps

    Permalink
    Definition Classes
    FieldUtils
  65. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  66. def keep(expr: ⇒ Boolean): Boolean

    Permalink

    Remembers the occurrence of some condition or event

    Remembers the occurrence of some condition or event

    Definition Classes
    StateManagement
  67. def keep[T](expr: ⇒ Option[T]): Option[T]

    Permalink

    Remembers the provided optional value, unless empty

    Remembers the provided optional value, unless empty

    Definition Classes
    StateManagement
  68. def limitedMemory[V, T](value: V, expValue: V, timeout: T)(implicit ev: Numeric[T]): (V, T)

    Permalink
    Definition Classes
    BlockT
  69. def meanCounter(value: Double, frequency: Long): Double

    Permalink
    Definition Classes
    GenericUtils
  70. def minId(): (StdLib_BuildingBlocks.this)#ID

    Permalink
    Definition Classes
    BlockS
  71. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  72. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  73. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  74. def once[T](expr: ⇒ T): Option[T]

    Permalink

    Returns a non-empty optional with the provided value just once, then None

    Returns a non-empty optional with the provided value just once, then None

    Definition Classes
    StateManagement
  75. def randomUid: (Double, (StdLib_BuildingBlocks.this)#ID)

    Permalink

    Generates a field of random unique identifiers.

    Generates a field of random unique identifiers.

    returns

    a tuple where the first element is a random number, end the second element is the device identifier to ensure uniqueness of the field elements.

    Definition Classes
    BlockS
  76. def recentlyTrue(dur: Duration, cond: ⇒ Boolean): Boolean

    Permalink
    Definition Classes
    TimeUtils
  77. def remember[T](value: ⇒ T): T

    Permalink

    Remembers the provided value

    Remembers the provided value

    Definition Classes
    StateManagement
  78. def roundCounter(): Long

    Permalink

    Counts the number of rounds, refreshing each time the computation is re-entered.

    Counts the number of rounds, refreshing each time the computation is re-entered. TODO: consider boundedness as a limitation for long-lived/eternal systems

    returns

    the number of the round

    Definition Classes
    StateManagement
  79. def sharedTimer(period: FiniteDuration): FiniteDuration

    Permalink
    Definition Classes
    TimeUtils
  80. def sharedTimerWithDecay[T](period: T, dt: T)(implicit ev: Numeric[T]): T

    Permalink

    Timer synchronized within a neighborhood

    Timer synchronized within a neighborhood

    Definition Classes
    BlockT
  81. def summarize(sink: Boolean, acc: (Double, Double) ⇒ Double, local: Double, Null: Double): Double

    Permalink
    Definition Classes
    BlocksWithGC
  82. def svdGradient(lagMetric: ⇒ Double = nbrLag().toMillis)(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink
    Definition Classes
    Gradients
  83. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  84. def timer[V](length: V)(implicit arg0: Numeric[V]): V

    Permalink
    Definition Classes
    BlockT
  85. def timerLocalTime(dur: Duration): Long

    Permalink
    Definition Classes
    TimeUtils
  86. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  87. def ultGradient(radius: Double = 0.2, factor: Double = 0.1)(source: Boolean, metric: (StdLib_BuildingBlocks.this)#Metric = nbrRange): Double

    Permalink
    Definition Classes
    Gradients
  88. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  89. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  90. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def G_along[V](g: Double, metric: (StdLib_BuildingBlocks.this)#Metric, field: V, acc: (V) ⇒ V): V

    Permalink

    Version of G (Gradient-Cast) that takes a potential field g as input

    Version of G (Gradient-Cast) that takes a potential field g as input

    V

    type of the value to be accumulated

    g

    potential field

    metric

    metric to use for the "last step"

    field

    value of the field for sources

    acc

    aggregator

    returns

    a field that locally provides the value of the gradient-cast (field at sources, and an accumulation value along the way)

    Definition Classes
    BlockG
    Deprecated

    As it seems buggy.

  2. def Gg[V](gradient: (BuildingBlocks.this)#Gradient, field: V, acc: (V) ⇒ V): V

    Permalink

    Version of G (Gradient-Cast) that takes a Gradient algorithm as input.

    Version of G (Gradient-Cast) that takes a Gradient algorithm as input. This is motivated by the desire of speeding G up by using

    gradient

    The gradient algorithm to use -- notice that this encapsulates details about the gradient field (e.g., the sources)

    Definition Classes
    BlockG
    Deprecated

    As it seems buggy: see G_along method.

  3. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from (StdLib_BuildingBlocks.this)#BlocksWithGC

Inherited from (StdLib_BuildingBlocks.this)#TimeUtils

Inherited from (StdLib_BuildingBlocks.this)#BlockT

Inherited from (StdLib_BuildingBlocks.this)#BlockS

Inherited from (StdLib_BuildingBlocks.this)#BlockC

Inherited from (StdLib_BuildingBlocks.this)#BlockG

Inherited from (StdLib_BuildingBlocks.this)#FieldUtils

Inherited from (StdLib_BuildingBlocks.this)#Gradients

Inherited from (StdLib_BuildingBlocks.this)#StateManagement

Inherited from (StdLib_BuildingBlocks.this)#GenericUtils

Inherited from AnyRef

Inherited from Any

Ungrouped