/// <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); }
public CreateOmnetNode(IActorRef node, OmnetSimulation.NodeType nodeType) { Node = node; NodeType = nodeType; }
public void CreateOmnetNode(IActorRef node, OmnetSimulation.NodeType nodeType = OmnetSimulation.NodeType.Undefined) { _actor.Tell(new NetworkActor.CreateOmnetNode(node, nodeType)); }