Ejemplo n.º 1
0
        /// <summary>
        /// Creates an actor in the actorsystem and in omnet++.
        /// </summary>
        /// <param name="props"></param>
        /// <param name="name"></param>
        /// <param name="nodeType"></param>
        /// <returns></returns>
        // ReSharper disable once InconsistentNaming
        private IActorRef CreateOMNeTActor(Props props, string name = null, OmnetSimulation.NodeType nodeType = OmnetSimulation.NodeType.Undefined)
        {
            // IMPORTANT: We MUST create all actors with the calling thread dispatcher, otherwise code will not be
            //            executed in a blocking manner.
            var actorRef = Context.ActorOf(props.WithDispatcher("calling-thread-dispatcher"), name);

            (_network as Network)?.CreateOmnetNode(actorRef, nodeType);
            return(actorRef);
        }
Ejemplo n.º 2
0
 public CreateOmnetNode(IActorRef node, OmnetSimulation.NodeType nodeType)
 {
     Node     = node;
     NodeType = nodeType;
 }
Ejemplo n.º 3
0
 public void CreateOmnetNode(IActorRef node, OmnetSimulation.NodeType nodeType = OmnetSimulation.NodeType.Undefined)
 {
     _actor.Tell(new NetworkActor.CreateOmnetNode(node, nodeType));
 }