Exemplo n.º 1
0
        private void HandleCapacity()
        {
            float sum;
            float max;

            if (!Environment.AgentNetwork.Any())
            {
                return;
            }

            if (Environment.Schedule.IsWorkingDay)
            {
                max = Environment.AgentNetwork.AllCognitiveAgents()
                      .Count(agent => agent.Cognitive.TasksAndPerformance.CanPerformTask);
                sum = Environment.AgentNetwork.AllCognitiveAgents()
                      .Where(agent => agent.Cognitive.TasksAndPerformance.CanPerformTask)
                      .Select(x => x.Capacity.Initial).Sum();
            }
            else
            {
                max = Environment.AgentNetwork.AllCognitiveAgents()
                      .Count(agent => agent.Cognitive.TasksAndPerformance.CanPerformTaskOnWeekEnds);
                sum = Environment.AgentNetwork.AllCognitiveAgents()
                      .Where(agent => agent.Cognitive.TasksAndPerformance.CanPerformTaskOnWeekEnds)
                      .Select(x => x.Capacity.Initial).Sum();
            }

            var density = new DensityStruct(sum, max, Environment.Schedule.Step);

            Capacity.Add(density);

            SumCapacity.Add(Capacity.Sum(x => x.ActualNumber));
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Sphere of interaction is the length of the network in the simulation, the number of connections between agents
        /// </summary>
        public void HandleLinks(ushort agentsCount)
        {
            var actualLinks = Environment.MainOrganization.ArtifactNetwork.ActorActor.Count;
            var maxLinks    = Combinatorics.Combinations(agentsCount, 2);
            var sphere      = new DensityStruct(actualLinks, maxLinks, Environment.Schedule.Step);

            Links.Add(sphere);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Sphere of interaction is the length of the network in the simulation, the number of connections between agents
        /// </summary>
        public void HandleSphere()
        {
            var actualSphereWeight = Environment.MainOrganization.ArtifactNetwork.InteractionSphere.GetSphereWeight();
            var maxSphereWeight    = Environment.MainOrganization.ArtifactNetwork.InteractionSphere.GetMaxSphereWeight();
            var sphere             = new DensityStruct(actualSphereWeight, maxSphereWeight, Environment.Schedule.Step);

            Sphere.Add(sphere);
        }
Exemplo n.º 4
0
        /// <summary>
        ///     One of the most fundamental types of groups is the triads
        ///     Rapid formation and reformation of triads is one key aspect of flexibility
        ///     For flexibility, Triads numbers are normalized with maximum potential triads
        /// </summary>
        public void HandleTriads(ushort agentsCount)
        {
            var numberOfTriads =
                InteractionMatrix.NumberOfTriads(Environment.MainOrganization.ArtifactNetwork.InteractionSphere.Sphere);
            var maxTriads = InteractionMatrix.MaxTriads(agentsCount);
            var triads    = new DensityStruct(numberOfTriads, maxTriads, Environment.Schedule.Step);

            Triads.Add(triads);
        }