trait BlocksWithShare extends AnyRef
This trait provides a set of blocks that can be used to implement the fast gradient algorithm and share operator. These are twice as fast as the standard blocks.
- Self Type
- MacroSwarmSupport.BlocksWithShare with E.AggregateProgram with E.StandardSensors with E.BlocksWithGC with MacroSwarmSupport.ProcessFix
- Alphabetic
- By Inheritance
- BlocksWithShare
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def CWithShare[P, V](potential: P, accumulator: (V, V) => V, local: V, Null: V)(implicit arg0: Bounded[P]): V
The C operator (collect-cast) used to collect values along a potential field.
The C operator (collect-cast) used to collect values along a potential field. This means that can be used to collect values into leader nodes.
- P
the type of the potential field
- V
the type of the value
- potential
the potential field (i.e., the result of a fast gradient)
- accumulator
the accumulator function
- local
the local value
- Null
the null value (i.e. acc(Null, v) = v)
- returns
the collected values along the potential field
- def GAlongWithShare[V](gradient: Double, field: V, accumulator: (V) => V, metric: E.Metric = nbrRange): V
A generalize gradient operator to accumulate values along a potential field.
A generalize gradient operator to accumulate values along a potential field.
- V
the type of the field
- gradient
the gradient value (i.e., the potential field)
- field
the field to be accumulated
- accumulator
the accumulator function
- metric
the metric used to compute the distance between two devices
- returns
the accumulated field along the gradient
- def GWithShare[V](source: Boolean, field: V, acc: (V) => V, metric: E.Metric = nbrRange): V
A generalized version of the gradient operator that can be used to accumulate values along the gradient
A generalized version of the gradient operator that can be used to accumulate values along the gradient
- V
the type of the field
- source
the source of the gradient (i.e., the device that has distance 0 from itself)
- field
the field to be accumulated
- acc
the accumulator function
- metric
the metric used to compute the distance between two devices
- returns
the accumulated field along the gradient
- def SWithShare(grain: Double, metric: E.Metric): Boolean
Sparse choice algorithm used to compute sparse leader in a network.
Sparse choice algorithm used to compute sparse leader in a network.
- grain
the grain used to define the distance threshold
- metric
the metric used to compute the distance between two devices
- returns
true if the device is a leader, false otherwise
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def breakUsingUidsWithShare(uid: (Double, E.ID), grain: Double, metric: E.Metric): Boolean
This function is used to break the symmetry between devices with the same distance from the source.
This function is used to break the symmetry between devices with the same distance from the source.
- uid
the unique identifier of the device composed of the distance and the device identifier
- grain
the grain used to define the distance threshold
- metric
the metric used to compute the distance between two devices
- returns
true if the device wins the competition, false otherwise
- def broadcastAlongWithShare[V](g: Double, value: V, metric: E.Metric = nbrRange): V
A generalized version of the broadcast operator that can be used to broadcast values along the gradient
A generalized version of the broadcast operator that can be used to broadcast values along the gradient
- V
the type of the value
- g
the gradient value (i.e., the potential field)
- value
the value to be broadcasted
- metric
the metric used to compute the distance between two devices
- returns
the broadcasted value along the gradient
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def distanceCompetitionWithShare(nbrInfo: () => ((Double, E.ID), Double), localInfo: ((Double, E.ID), Double), grain: Double, metric: E.Metric): (Double, E.ID)
This function is used to compute the distance competition between two devices.
This function is used to compute the distance competition between two devices. The competition is based on the distance between the two devices and the grain. The grain is a parameter that is used to define the distance threshold. If the distance between the two devices is less than the grain, the competition is based on the distance. Otherwise, the competition is based on the distance between the device and the grain.
- nbrInfo
the information of the neighbor computed through the share operator
- localInfo
the information of the local device
- grain
the grain used to define the distance threshold
- metric
the metric used to compute the distance between two devices
- returns
the information of the device that wins the competition (i.e., the leader)
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fastGradient(source: Boolean, metric: E.Metric = nbrRange): Double
Tha gradient algorithm used to compute the distance from the source.
Tha gradient algorithm used to compute the distance from the source. Internally it uses the share operator.
- source
the source of the gradient (i.e., the device that has distance 0 from itself)
- metric
the metric used to compute the distance between two devices
- returns
the distance from the source
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)