Packages

trait PatternFormationLib extends AnyRef

a library for creating spatial patterns in the swarm. The behaviour is based on the gradient of a potential field.

Therefore, for creating a shape, it should exist a leader responsible for that shape.

Team formation and pattern formation can be used together to create a shape with a team of nodes.

Currently, the shapes supported are: line, circle, and v-shape.

Self Type
MacroSwarmSupport.PatternFormationLib with E.AggregateProgram with E.StandardSensors with E.FieldUtils with E.TimeUtils with MacroSwarmSupport.BaseMovementLib with E.CustomSpawn with E.BlocksWithGC with MacroSwarmSupport.BlocksWithShare
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PatternFormationLib
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type AllocationStrategy = (List[(E.ID, Point3D)], List[Point3D], Boolean) => Map[E.ID, Point3D]

Abstract Value Members

  1. abstract def allPosition(center: E.ID): List[(E.ID, Point3D)]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def centeredCircle(leader: Boolean, radius: Double, confidence: Double, leaderVelocity: => Point3D = Point3D.Zero): Point3D

    Creates a circle shape.

    Creates a circle shape. The leader is responsible for the shape. The nodes are placed in a circle with a distance.

    Example: ooo o o o x o o o ooo Example of usage (leader id = 1): scala centeredCircle(leader = mid() == 1, radius = 100, confidence = 0.1)

    leader

    whether the node is the leader or not

    radius

    the radius of the circle

    confidence

    the confidence of the shape, i.e., how much error is allowed for the given distance

    leaderVelocity

    the velocity of the leader

    returns

    the velocity of the node in order to form the shape

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def isCircleFormed(source: Boolean, targetDistance: Double, confidence: Double): Boolean

    A utility function for verifying whether a circle is formed or not.

    A utility function for verifying whether a circle is formed or not.

    source

    whether the node is the leader or not

    targetDistance

    the target distance between the nodes in the circle

    confidence

    the confidence of the shape, i.e., how much error is allowed for the given distance

    returns

    whether the circle is formed or not

  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def line(leader: Boolean, distance: Double, confidence: Double, leaderVelocity: => Point3D = Point3D.Zero): Point3D

    Creates a line shape.

    Creates a line shape. The leader is responsible for the shape. The nodes are placed in a line with a distance Example: o -- o -- x -- o -- o

    leader

    the leader of the shape

    distance

    between the node of the shape

    confidence

    the confidence of the shape, i.e., how much error is allowed for the given distance

    leaderVelocity

    the velocity of the leader

    returns

    the velocity of the node in order to form the shape

  14. def log(key: String, data: Any): Unit
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. def vShape(leader: Boolean, oldVelocity: Point3D, distance: Double, radius: Double, confidence: Double, leaderVelocity: Point3D = Point3D.Zero): Point3D

    Creates a v-shape.

    Creates a v-shape. The leader is responsible for the shape. The nodes are placed in a v-shape with a distance example: x o o o o example of usage (leader id = 1): scala rep(Point3D.Zero) { oldVelocity => vShape(leader = mid() == 1, oldVelocity = velocity, distance = 100, radius = Math.PI / 2, confidence = 0.1) }

    leader

    the leader of the shape

    oldVelocity

    the old velocity of the node (that means it should be used inside a rep)

    distance

    the target distance between the node of the shape

    radius

    the angle of the v-shape

    confidence

    the confidence of the shape, i.e., how much error is allowed for the given distance

    leaderVelocity

    the velocity of the leader

    returns

    the velocity of the node in order to form the shape

  21. def vShapeSuggestions(nodes: List[(E.ID, Point3D)], distance: Double, radius: Double, oldVelocity: Point3D, allocationStrategy: (PatternFormationLib.this)#AllocationStrategy = distanceBasedAllocation, shouldLog: Boolean = false): Map[E.ID, Point3D]
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped