public static ActorPaths CreateActorPaths(TestKit testKit, IActorRef simContext) { var simSystem = testKit.CreateTestProbe(); var inbox = Inbox.Create(system: testKit.Sys); var agentPaths = new ActorPaths(simulationContext: simContext, systemMailBox: inbox.Receiver); agentPaths.SetSupervisorAgent(systemAgent: simSystem); agentPaths.Guardians.Add(GuardianType.Contract, testKit.CreateTestProbe()); agentPaths.Guardians.Add(GuardianType.Dispo, testKit.CreateTestProbe()); agentPaths.Guardians.Add(GuardianType.Production, testKit.CreateTestProbe()); return(agentPaths); }
private void CreateSupervisor(Configuration configuration) { var products = _dBContext.GetProducts(); var initialTime = configuration.GetOption <EstimatedThroughPut>().Value; var estimatedThroughputs = products.Select(a => new FSetEstimatedThroughputTime(a.Id, initialTime, a.Name)) .ToList(); ActorPaths.SetSupervisorAgent(systemAgent: _simulation.ActorSystem .ActorOf(props: Supervisor.Props(actorPaths: ActorPaths, time: 0, debug: _debugAgents, productionDomainContext: _dBContext, messageHub: _messageHub, configuration: configuration, estimatedThroughputTimes: estimatedThroughputs, principal: ActorRefs.Nobody), name: "Supervisor")); }
private void CreateSupervisor(Configuration configuration) { var products = _dBContext.GetProducts(); var initialTime = configuration.GetOption <EstimatedThroughPut>().Value; var estimatedThroughPuts = products.Select(a => new FSetEstimatedThroughputTime(a.Id, initialTime, a.Name)) .ToList(); var behave = Agents.SupervisorAgent.Behaviour.Factory.Default( productionDomainContext: _dBContext, messageHub: _messageHub, configuration: configuration, estimatedThroughputTimes: estimatedThroughPuts); ActorPaths.SetSupervisorAgent(systemAgent: _simulation.ActorSystem .ActorOf(props: Supervisor.Props(actorPaths: ActorPaths, time: 0, debug: _debugAgents, principal: ActorRefs.Nobody), name: "Supervisor")); _simulation.SimulationContext.Tell(message: BasicInstruction.Initialize.Create(target: ActorPaths.SystemAgent.Ref, message: behave)); }