Packages

  • package root
    Definition Classes
    root
  • package se
    Definition Classes
    root
  • package sics
    Definition Classes
    se
  • package kompics
    Definition Classes
    sics
  • package sl

    This package contains the Scala DSL for Kompics.

    This package contains the Scala DSL for Kompics.

    It is recommended to import this as import se.sics.kompics.sl._, since it contains a number of implicit conversions and convenience methods that are good to have in scope.

    Definition Classes
    kompics
  • package simulator

    The Kompics Simulator DSL for Scala

    The Kompics Simulator DSL for Scala

    Definition Classes
    sl
    Example:
    1. case object SimpleSimulation {
      
        import Distributions._
        // needed for the distributions, but needs to be initialised after setting the seed
        implicit val random = JSimulationScenario.getRandom();
      
        private def intToAddress(i: Int): Address = {
          try {
            new TAddress(new InetSocketAddress(InetAddress.getByName("192.193.0." + i), 10000));
          } catch {
            case ex: UnknownHostException => throw new RuntimeException(ex);
          }
        }
      
        val startResultSetterOp = Op { (self: Integer) =>
          val selfAddr = intToAddress(self);
          StartNode(selfAddr, Init[ResultSetter](selfAddr))
        };
        val startPongerOp = Op { (self: Integer) =>
          val selfAddr = intToAddress(self)
          StartNode(selfAddr, Init[PongerParent](selfAddr))
        };
        val startPingerOp = Op { (self: Integer, ponger: Integer) =>
          val selfAddr = intToAddress(self);
          val pongerAddr = intToAddress(ponger);
          StartNode(selfAddr, Init[PingerParent](selfAddr, pongerAddr))
        };
      
        val scenario = raise(5, startPongerOp, 1.toN)
          .arrival(constant(1000.millis))
          .andThen(1000.millis)
          .afterTermination(raise(5, startPingerOp, 6.toN, 1.toN).arrival(constant(1000.millis)))
          .inParallel(raise(1, startResultSetterOp, 1.toN).arrival(constant(1000.millis)))
          .andThen(10000.millis)
          .afterTermination(Terminate);
      }
  • ChangeNetwork
  • Distributions
  • IntDistributions
  • KillNode
  • Op
  • Setup
  • SimulationResult
  • StartNode
  • StochasticProcess
  • StochasticProcessBuilder
  • StochasticProcessChain
  • Terminate

object Op

Operations of various arities, which produce a KompicsEvent

Arities from zero to five are provided.

Use these to map parameters to simulator events using the various raise functions.

Example:
  1. raise(5,
      Op { (self: Integer, other: Integer) =>
        val selfAddr = lookupAddress(self); /* Get an address instance for the id */
        val otherAddr = lookupAddress(ponger); /* Get an address instance for the id */
        StartNode(selfAddr, Init[NewComponent](selfAddr, otherAddr))
      },
      1.toN, 2.toN)
See also

se.sics.kompics.simulator.adaptor.Operation

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Op
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class FunctionOperation[E <: KompicsEvent] extends Operation[E]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation

  2. class FunctionOperation1[E <: KompicsEvent, N <: Number] extends Operation1[E, N]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation1

  3. class FunctionOperation2[E <: KompicsEvent, N <: Number, N2 <: Number] extends Operation2[E, N, N2]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation2

  4. class FunctionOperation3[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number] extends Operation3[E, N, N2, N3]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation3

  5. class FunctionOperation4[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number, N4 <: Number] extends Operation4[E, N, N2, N3, N4]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation4

  6. class FunctionOperation5[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number, N4 <: Number, N5 <: Number] extends Operation5[E, N, N2, N3, N4, N5]

    An operation implementation that uses a Scala function internally

    An operation implementation that uses a Scala function internally

    See also

    se.sics.kompics.simulator.adaptor.Operation5

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. def apply[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number, N4 <: Number, N5 <: Number](generator: (N, N2, N3, N4, N5) => E): Operation5[E, N, N2, N3, N4, N5]

    Five parameter generator

    Five parameter generator

    E

    the type of event to produce

    N

    the type of the first parameter

    N2

    the type of the second parameter

    N3

    the type of the third parameter

    N4

    the type of the fourth parameter

    N5

    the type of the fifth parameter

    generator

    the function that produces the event

    returns

    a FunctionOperation5 instance

  5. def apply[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number, N4 <: Number](generator: (N, N2, N3, N4) => E): Operation4[E, N, N2, N3, N4]

    Four parameter generator

    Four parameter generator

    E

    the type of event to produce

    N

    the type of the first parameter

    N2

    the type of the second parameter

    N3

    the type of the third parameter

    N4

    the type of the fourth parameter

    generator

    the function that produces the event

    returns

    a FunctionOperation4 instance

  6. def apply[E <: KompicsEvent, N <: Number, N2 <: Number, N3 <: Number](generator: (N, N2, N3) => E): Operation3[E, N, N2, N3]

    Three parameter generator

    Three parameter generator

    E

    the type of event to produce

    N

    the type of the first parameter

    N2

    the type of the second parameter

    N3

    the type of the third parameter

    generator

    the function that produces the event

    returns

    a FunctionOperation3 instance

  7. def apply[E <: KompicsEvent, N <: Number, N2 <: Number](generator: (N, N2) => E): Operation2[E, N, N2]

    Two parameter generator

    Two parameter generator

    E

    the type of event to produce

    N

    the type of the first parameter

    N2

    the type of the second parameter

    generator

    the function that produces the event

    returns

    a FunctionOperation2 instance

  8. def apply[E <: KompicsEvent, N <: Number](generator: (N) => E): Operation1[E, N]

    Single parameter generator

    Single parameter generator

    E

    the type of event to produce

    N

    the type of the parameter

    generator

    the function that produces the event

    returns

    a FunctionOperation1 instance

  9. def apply[E <: KompicsEvent](generator: (Unit) => E): Operation[E]

    Zero parameter generator

    Zero parameter generator

    E

    the type of event to produce

    generator

    the function that produces the event

    returns

    a FunctionOperation instance

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  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
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped