private void CreateHubAgent(IActorRef directory, Configuration configuration) { WorkTimeGenerator randomWorkTime = WorkTimeGenerator.Create(configuration: configuration, 0); var hubInfo = new FResourceHubInformation(resourceList: _resourceDictionary , dbConnectionString: _ganttContext.Database.GetDbConnection().ConnectionString , masterDbConnectionString: _productionContext.Database.GetDbConnection().ConnectionString , workTimeGenerator: randomWorkTime); _simulation.SimulationContext.Tell( message: Directory.Instruction.Central.CreateHubAgent.Create(hubInfo, directory), sender: ActorRefs.NoSender); }
private void CreateHubAgent(FResourceHubInformation resourceHubInformation) { var hubAgent = Agent.Context.ActorOf(props: Hub.Props(actorPaths: Agent.ActorPaths , time: Agent.CurrentTime , simtype: SimulationType , maxBucketSize: 0 // not used currently , dbConnectionStringGanttPlan: resourceHubInformation.DbConnectionString , dbConnectionStringMaster: resourceHubInformation.MasterDbConnectionString , workTimeGenerator: resourceHubInformation.WorkTimeGenerator as WorkTimeGenerator , debug: Agent.DebugThis , principal: Agent.Context.Self) , name: "CentralHub"); HubAgentActorRef = hubAgent; System.Diagnostics.Debug.WriteLine($"Created Central Hub !"); }
private void CreateResourceHubAgents(FResourceHubInformation capabilityDefinition) { // Create Capability based Hub Agent for each Capability of resource var capability = capabilityDefinition.Capability as M_ResourceCapability; var hub = hubManager.GetHubActorRefBy(capability.Name); if (hub == null) { var hubAgent = Agent.Context.ActorOf(props: Hub.Props(actorPaths: Agent.ActorPaths , time: Agent.CurrentTime , simtype: SimulationType , maxBucketSize: capabilityDefinition.MaxBucketSize , workTimeGenerator: capabilityDefinition.WorkTimeGenerator as WorkTimeGenerator , debug: Agent.DebugThis , principal: Agent.Context.Self) , name: "Hub(" + capability.Name + ")"); System.Diagnostics.Debug.WriteLine($"Created Hub {capability.Name} with {capabilityDefinition.MaxBucketSize} !"); hubManager.AddOrCreateRelation(hubAgent, capability); } }