Beispiel #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();
        }
Beispiel #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);
        }
Beispiel #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();
        }
Beispiel #4
0
        private void LoadSettings()
        {
            DisplayButtons();

            InfluenceModelOn.Checked     = _mainOrganization.Models.Influence.On;
            InfluenceRateOfAgentsOn.Text =
                _mainOrganization.Models.Influence.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);

            BeliefsModelOn.Checked     = _mainOrganization.Models.Beliefs.On;
            BeliefsRateOfAgentsOn.Text =
                _mainOrganization.Models.Beliefs.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);

            tbWorkers.Text     = _mainOrganization.WorkersCount.ToString(CultureInfo.InvariantCulture);
            tbInfluencers.Text = _mainOrganization.InfluencersCount.ToString(CultureInfo.InvariantCulture);
            tbBeliefs.Text     = _mainOrganization.BeliefCount.ToString(CultureInfo.InvariantCulture);

            HasBeliefs.Checked        = _mainOrganization.Templates.Human.Cognitive.KnowledgeAndBeliefs.HasBelief;
            ThresholdForReacting.Text =
                _mainOrganization.Murphies.IncompleteBelief.ThresholdForReacting
                .ToString(CultureInfo.InvariantCulture);

            #region Influencer

            InfluencerBeliefLevel.Items.AddRange(BeliefLevelService.GetNames());
            InfluencerBeliefLevel.SelectedItem = BeliefLevelService.GetName(_mainOrganization.InfluencerTemplate
                                                                            .Cognitive
                                                                            .KnowledgeAndBeliefs.DefaultBeliefLevel);
            MinimumBeliefToSendPerBit.Text = _mainOrganization.InfluencerTemplate.Cognitive.MessageContent
                                             .MinimumBeliefToSendPerBit.ToString(CultureInfo.InvariantCulture);
            MinimumNumberOfBitsOfBeliefToSend.Text = _mainOrganization.InfluencerTemplate.Cognitive.MessageContent
                                                     .MinimumNumberOfBitsOfBeliefToSend.ToString(CultureInfo.InvariantCulture);
            MaximumNumberOfBitsOfBeliefToSend.Text = _mainOrganization.InfluencerTemplate.Cognitive.MessageContent
                                                     .MaximumNumberOfBitsOfBeliefToSend.ToString(CultureInfo.InvariantCulture);
            InfluentialnessMin.Text = _mainOrganization.InfluencerTemplate.Cognitive.InternalCharacteristics
                                      .InfluentialnessRateMin.ToString(CultureInfo.InvariantCulture);
            InfluentialnessMax.Text = _mainOrganization.InfluencerTemplate.Cognitive.InternalCharacteristics
                                      .InfluentialnessRateMax.ToString(CultureInfo.InvariantCulture);
            CanSendBeliefs.Checked = _mainOrganization.InfluencerTemplate.Cognitive.MessageContent.CanSendBeliefs;

            #endregion

            #region Worker

            MandatoryRatio.Text =
                _mainOrganization.Murphies.IncompleteBelief.MandatoryRatio.ToString(CultureInfo.InvariantCulture);


            RiskAversion.Items.AddRange(GenericLevelService.GetNames());
            RiskAversion.SelectedItem =
                GenericLevelService.GetName(_mainOrganization.WorkerTemplate.Cognitive.InternalCharacteristics
                                            .RiskAversionLevel);

            BeliefWeight.Items.AddRange(BeliefWeightLevelService.GetNames());
            BeliefWeight.SelectedItem =
                BeliefWeightLevelService.GetName(_mainOrganization.Models.BeliefWeightLevel);
            InfluenceabilityMin.Text = _mainOrganization.WorkerTemplate.Cognitive.InternalCharacteristics
                                       .InfluenceabilityRateMin.ToString(CultureInfo.InvariantCulture);
            InfluenceabilityMax.Text = _mainOrganization.WorkerTemplate.Cognitive.InternalCharacteristics
                                       .InfluenceabilityRateMax.ToString(CultureInfo.InvariantCulture);
            CanReceiveBeliefs.Checked = _mainOrganization.WorkerTemplate.Cognitive.MessageContent.CanReceiveBeliefs;
            HasInitialBeliefs.Checked =
                _mainOrganization.WorkerTemplate.Cognitive.KnowledgeAndBeliefs.HasInitialBelief;

            #endregion
        }
Beispiel #5
0
        private void LoadSettings()
        {
            DisplayButtons();

            #region Knowledge

            tbKnowledgeLength.Text    = "50";
            cbBinaryKnowledge.Checked =
                _mainOrganization.Models.Generator == RandomGenerator.RandomBinary;

            #endregion

            #region Learning

            cbLearningOn.Checked          = true;
            tbMicroLearningAgentRate.Text = "1";
            cbHasInitialKnowledge.Checked = _mainOrganization.Templates.Human.Cognitive.KnowledgeAndBeliefs
                                            .HasInitialKnowledge;
            cbInitialKnowledgeLevel.Items.AddRange(KnowledgeLevelService.GetNames());
            cbInitialKnowledgeLevel.SelectedItem = KnowledgeLevelService.GetName(_mainOrganization.KnowledgeLevel);
            cbHasKnowledge.Checked =
                _mainOrganization.Templates.Human.Cognitive.KnowledgeAndBeliefs.HasKnowledge;
            tbKnowledgeThreshold.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.ThresholdForReacting
                .ToString(CultureInfo.InvariantCulture);
            tbTimeToLive.Text =
                _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.TimeToLive.ToString(
                    CultureInfo.InvariantCulture);
            tbLearnRate.Text =
                _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.LearningRate.ToString(CultureInfo
                                                                                                      .InvariantCulture);
            tbLearnByDoingRate.Text =
                _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.LearningByDoingRate.ToString(
                    CultureInfo.InvariantCulture);
            tbTaskCostFactor.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.CostFactorOfGuessing
                .ToString(CultureInfo.InvariantCulture);
            cbCanSendKnowledge.Checked =
                _mainOrganization.Templates.Human.Cognitive.MessageContent.CanSendKnowledge;
            cbCanReceiveKnowledge.Checked =
                _mainOrganization.Templates.Human.Cognitive.MessageContent.CanReceiveKnowledge;
            // Email
            tbMinKnowledge.Text =
                _mainOrganization.Templates.Human.Cognitive.MessageContent.MinimumKnowledgeToSendPerBit.ToString(
                    CultureInfo.InvariantCulture);
            tbMinBitsKnowledge.Text =
                _mainOrganization.Templates.Human.Cognitive.MessageContent.MinimumNumberOfBitsOfKnowledgeToSend
                .ToString(CultureInfo.InvariantCulture);
            tbMaxBitsKnowledge.Text =
                _mainOrganization.Templates.Human.Cognitive.MessageContent.MaximumNumberOfBitsOfKnowledgeToSend
                .ToString(CultureInfo.InvariantCulture);
            tbMaxRateLearnable.Text =
                _mainOrganization.Communication.Email.MaxRateLearnable.ToString(CultureInfo.InvariantCulture);

            #endregion

            #region Forgetting

            cbForgettingOn.Checked     = true;
            tbForgettingAgentRate.Text = "1";
            tbForgettingMean.Text      =
                _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.ForgettingMean.ToString(
                    CultureInfo.InvariantCulture);
            cgForgettingStdDev.Items.AddRange(GenericLevelService.GetNames());
            cgForgettingStdDev.SelectedItem =
                GenericLevelService.GetName(_mainOrganization.Templates.Human.Cognitive.InternalCharacteristics
                                            .ForgettingStandardDeviation);
            cbPartialForgetting.Checked = _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics
                                          .PartialForgetting;
            tbPartialForgettingRate.Text =
                _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.PartialForgettingRate
                .ToString(CultureInfo.InvariantCulture);
            tbMinimRemainningLevel.Text =
                _mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.MinimumRemainingKnowledge
                .ToString(CultureInfo.InvariantCulture);
            switch (_mainOrganization.Templates.Human.Cognitive.InternalCharacteristics.ForgettingSelectingMode)
            {
            case ForgettingSelectingMode.Random:
                rbICForgettingSelectingRandomMode.Checked = true;
                break;

            case ForgettingSelectingMode.Oldest:
                rbICForgettingSelectingOldestMode.Checked = true;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            #endregion
        }
Beispiel #6
0
        private void LoadSettings()
        {
            DisplayButtons();

            #region Environment

            InitialCapacity.Text      = _mainOrganization.InitialCapacity.ToString(CultureInfo.InvariantCulture);
            SwitchingContextCost.Text = _mainOrganization.SwitchingContextCost.ToString(CultureInfo.InvariantCulture);
            costOfTask.Text           = _mainOrganization.CostOfTask.ToString(CultureInfo.InvariantCulture);
            numberTasksSent.Text      = _mainOrganization.NumberOfTasks.ToString(CultureInfo.InvariantCulture);

            #endregion

            #region Task model

            CanPerformTask.Checked =
                _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.CanPerformTask;
            CanPerformTasksOnWeekends.Checked = _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance
                                                .CanPerformTaskOnWeekEnds;
            LimitNumberTasks.Checked = _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.TasksLimit
                                       .LimitTasksInTotal;
            maxNumberTasks.Text =
                _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.TasksLimit.MaximumTasksInTotal
                .ToString(CultureInfo.InvariantCulture);
            LimitSimultaneousTasks.Checked = _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance
                                             .TasksLimit
                                             .LimitSimultaneousTasks;
            MaxSimultaneousTasks.Text =
                _mainOrganization.Templates.Human.Cognitive.TasksAndPerformance.TasksLimit
                .MaximumSimultaneousTasks
                .ToString(CultureInfo.InvariantCulture);
            AgentCanBeIsolated.Items.AddRange(FrequencyLevelService.GetNames());
            AgentCanBeIsolated.SelectedItem = FrequencyLevelService.GetName(_mainOrganization.Templates.Human
                                                                            .Cognitive.InteractionPatterns.AgentCanBeIsolated);

            #endregion

            #region Message model

            LimitMessages.Checked = _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics
                                    .LimitMessagesPerPeriod;
            MaxMessages.Text =
                _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics.MaximumMessagesPerPeriod
                .ToString(CultureInfo.InvariantCulture);
            LimitMessagesSent.Checked = _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics
                                        .LimitMessagesSentPerPeriod;
            MaxMessagesSent.Text =
                _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics
                .MaximumMessagesSentPerPeriod
                .ToString(CultureInfo.InvariantCulture);
            LimitMessagesReceived.Checked = _mainOrganization.Templates.Human.Cognitive
                                            .InteractionCharacteristics.LimitReceptionsPerPeriod;
            MaxMessagesReceived.Text =
                _mainOrganization.Templates.Human.Cognitive.InteractionCharacteristics.MaximumReceptionsPerPeriod
                .ToString(CultureInfo.InvariantCulture);

            CostToSend.Items.AddRange(GenericLevelService.GetNames());
            CostToSend.Text =
                GenericLevelService.GetName(_mainOrganization.Communication.Email.CostToSendLevel);
            CostToReceive.Items.AddRange(GenericLevelService.GetNames());
            CostToReceive.Text =
                GenericLevelService.GetName(_mainOrganization.Communication.Email.CostToReceiveLevel);

            #endregion
        }