public static Props Props(ActorPaths actorPaths , ICollectorBehaviour collectorBehaviour , IMessageHub msgHub , Configuration configuration , long time , bool debug , List <Type> streamTypes) { return(Akka.Actor.Props.Create( factory: () => new Collector(actorPaths, collectorBehaviour, msgHub, configuration, time, streamTypes))); }
/// <summary> /// Collector Agent for Life data Aquesition /// </summary> /// <param name="actorPaths"></param> /// <param name="time">Current time span</param> /// <param name="debug">Parameter to activate Debug Messages on Agent level</param> public Collector(ActorPaths paths , ICollectorBehaviour collectorBehaviour , IMessageHub msgHub , Configuration configuration , long time , List <Type> streamTypes) : base(time: time, channels: streamTypes) { Console.WriteLine(value: "I'm alive: " + Self.Path.ToStringWithAddress()); collectorBehaviour.Collector = this; Behaviour = collectorBehaviour; messageHub = msgHub; Config = configuration; actorPaths = paths; simulationId = Config.GetOption <SimulationId>(); simulationNumber = Config.GetOption <SimulationNumber>(); simulationKind = Config.GetOption <SimulationKind>(); saveToDB = Config.GetOption <SaveToDB>(); }
/// <summary> /// Collector Agent for Life data Aquesition /// </summary> /// <param name="actorPaths"></param> /// <param name="time">Current time span</param> /// <param name="debug">Parameter to activate Debug Messages on Agent level</param> public Collector(ActorPaths paths , ICollectorBehaviour collectorBehaviour , IMessageHub msgHub , Configuration configuration , long time , List <Type> streamTypes) : base(time: time, channels: streamTypes) { collectorBehaviour.Collector = this; Behaviour = collectorBehaviour; messageHub = msgHub; Config = configuration; actorPaths = paths; simulationId = Config.GetOption <SimulationId>(); simulationNumber = Config.GetOption <SimulationNumber>(); simulationKind = Config.GetOption <SimulationKind>(); saveToDB = Config.GetOption <SaveToDB>(); maxTime = Config.GetOption <SimulationEnd>().Value; messageHub.SendToAllClients(msg: "Collector initialized: " + Self.Path.ToStringWithAddress()); }