Example #1
0
        protected override void SetUpOrganization()
        {
            base.SetUpOrganization();

            _mainOrganization.Models.Influence.On = InfluenceModelOn.Checked;
            _mainOrganization.Models.Beliefs.On   = BeliefsModelOn.Checked;

            _mainOrganization.WorkerTemplate.Cognitive.InternalCharacteristics.RiskAversionLevel =
                GenericLevelService.GetValue(RiskAversion.SelectedItem.ToString());

            #region influencer

            _mainOrganization.InfluencerTemplate.Cognitive.KnowledgeAndBeliefs.HasBelief          = HasBeliefs.Checked;
            _mainOrganization.InfluencerTemplate.Cognitive.MessageContent.CanSendBeliefs          = CanSendBeliefs.Checked;
            _mainOrganization.InfluencerTemplate.Cognitive.KnowledgeAndBeliefs.DefaultBeliefLevel =
                BeliefLevelService.GetValue(InfluencerBeliefLevel.SelectedItem.ToString());

            #endregion

            #region Worker

            _mainOrganization.WorkerTemplate.Cognitive.KnowledgeAndBeliefs.HasBelief        = HasBeliefs.Checked;
            _mainOrganization.WorkerTemplate.Cognitive.KnowledgeAndBeliefs.HasInitialBelief = HasInitialBeliefs.Checked;
            _mainOrganization.WorkerTemplate.Cognitive.MessageContent.CanReceiveBeliefs     = CanReceiveBeliefs.Checked;
            _mainOrganization.Models.BeliefWeightLevel =
                BeliefWeightLevelService.GetValue(BeliefWeight.SelectedItem.ToString());

            #endregion

            _mainOrganization.AddBeliefs();
        }
Example #2
0
        protected override void SetUpOrganization()
        {
            base.SetUpOrganization();
            Iterations.Max = ushort.Parse(NumberOfIterations.Text, CultureInfo.InvariantCulture);

            #region Task model

            _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.CanPerformTask =
                CanPerformTask.Checked;
            _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.CanPerformTaskOnWeekEnds =
                CanPerformTasksOnWeekends.Checked;
            _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.TasksLimit
            .LimitTasksInTotal = LimitNumberTasks.Checked;
            _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.TasksLimit
            .LimitSimultaneousTasks = LimitSimultaneousTasks.Checked;

            _mainOrganization.Templates.Human.Cognitive.InteractionPatterns.AgentCanBeIsolated =
                FrequencyLevelService.GetValue(AgentCanBeIsolated.SelectedItem.ToString());
            try
            {
                _mainOrganization.InitialCapacity = float.Parse(InitialCapacity.Text);
                InitialCapacity.BackColor         = SystemColors.Window;
            }
            catch (FormatException)
            {
                InitialCapacity.BackColor = Color.Red;
            }

            #endregion

            #region message

            _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics.LimitMessagesPerPeriod =
                LimitMessages.Checked;
            _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics.LimitMessagesSentPerPeriod =
                LimitMessagesSent.Checked;
            _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics.LimitReceptionsPerPeriod =
                LimitMessagesReceived.Checked;

            _mainOrganization.Communication.Email.CostToSendLevel =
                GenericLevelService.GetValue(CostToSend.SelectedItem.ToString());
            _mainOrganization.Communication.Email.CostToReceiveLevel =
                GenericLevelService.GetValue(CostToReceive.SelectedItem.ToString());

            #endregion

            var scenario = TimeBasedScenario.CreateInstance(_environment);
            scenario.NumberOfSteps = ushort.Parse(tbSteps.Text, CultureInfo.InvariantCulture);
            AddScenario(scenario);

            SetRandomLevel(cbRandomLevel.SelectedIndex);
            SetTimeStepType(TimeStepType.Daily);
        }
Example #3
0
        protected override void SetUpOrganization()
        {
            base.SetUpOrganization();

            #region Knowledge

            _mainOrganization.Models.Generator = cbBinaryKnowledge.Checked
                ? RandomGenerator.RandomBinary
                : RandomGenerator.RandomUniform;

            #endregion

            #region Learning

            _mainOrganization.Models.Learning.On = cbLearningOn.Checked;
            _mainOrganization.Templates.Human.Cognitive.KnowledgeAndBeliefs.HasKnowledge =
                cbHasKnowledge.Checked;
            _mainOrganization.Templates.Human.Cognitive.KnowledgeAndBeliefs.HasInitialKnowledge =
                cbHasInitialKnowledge.Checked;
            _mainOrganization.KnowledgeLevel =
                KnowledgeLevelService.GetValue(cbInitialKnowledgeLevel.SelectedItem.ToString());

            _mainOrganization.Templates.Human.Cognitive.MessageContent.CanSendKnowledge =
                cbCanSendKnowledge.Checked;
            _mainOrganization.Templates.Human.Cognitive.MessageContent.CanReceiveKnowledge =
                cbCanReceiveKnowledge.Checked;

            #endregion

            #region Forgetting

            _mainOrganization.Models.Forgetting.On = cbForgettingOn.Checked;
            _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.ForgettingStandardDeviation =
                GenericLevelService.GetValue(cgForgettingStdDev.SelectedItem.ToString());
            _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.PartialForgetting =
                cbPartialForgetting.Checked;
            _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.ForgettingSelectingMode =
                rbICForgettingSelectingRandomMode.Checked
                    ? ForgettingSelectingMode.Random
                    : ForgettingSelectingMode.Oldest;

            #endregion

            _fullKnowledge = 0;
            var scenario = TimeBasedScenario.CreateInstance(_environment);
            scenario.NumberOfSteps = ushort.Parse(tbSteps.Text, CultureInfo.InvariantCulture);
            AddScenario(scenario);

            SetRandomLevel(cbRandomLevel.SelectedIndex);
            _mainOrganization.AddWiki();
        }