示例#1
0
文件: Home.cs 项目: lmorisse/Symu
        private void LoadSettings()
        {
            DisplayButtons();

            #region Environment

            tbWorkers.Text   = _mainOrganization.WorkersCount.ToString(CultureInfo.InvariantCulture);
            GroupsCount.Text = _mainOrganization.GroupsCount.ToString(CultureInfo.InvariantCulture);

            #endregion

            #region sphere of interaction

            RadomlyGenerated.Checked     = true;
            AllowNewInteractions.Checked = true;
            MaxSphereDensity.Text        =
                _mainOrganization.Models.InteractionSphere.MaxSphereDensity.ToString(CultureInfo.InvariantCulture);
            MinSphereDensity.Text =
                _mainOrganization.Models.InteractionSphere.MinSphereDensity.ToString(CultureInfo.InvariantCulture);
            WeightKnowledge.Text =
                _mainOrganization.Models.InteractionSphere.RelativeKnowledgeWeight.ToString(CultureInfo
                                                                                            .InvariantCulture);
            WeightActivities.Text =
                _mainOrganization.Models.InteractionSphere.RelativeActivityWeight.ToString(
                    CultureInfo.InvariantCulture);
            WeightBeliefs.Text =
                _mainOrganization.Models.InteractionSphere.RelativeBeliefWeight.ToString(CultureInfo.InvariantCulture);
            WeightGroups.Text =
                _mainOrganization.Models.InteractionSphere.SocialDemographicWeight.ToString(CultureInfo
                                                                                            .InvariantCulture);

            #endregion

            #region Interaction

            _mainOrganization.Models.InteractionSphere.SetInteractionPatterns(InteractionStrategy.Homophily);
            _mainOrganization.Templates.Human.Cognitive.InteractionPatterns.LimitNumberOfNewInteractions = true;
            _mainOrganization.Templates.Human.Cognitive.InteractionPatterns.ThresholdForNewInteraction   = 0.1F;
            ThresholdFornewInteraction.Text = _mainOrganization.Templates.Human.Cognitive.InteractionPatterns
                                              .ThresholdForNewInteraction.ToString(CultureInfo.InvariantCulture);
            MaxDailyInteractions.Text = "2";

            Homophily.Checked = true;

            #endregion

            #region Knowledge

            KnowledgeRandom.Checked = true;
            cbInitialKnowledgeLevel.Items.AddRange(KnowledgeLevelService.GetNames());
            cbInitialKnowledgeLevel.SelectedItem = KnowledgeLevelService.GetName(_mainOrganization.KnowledgeLevel);

            #endregion

            #region Activities

            ActivitiesRandom.Checked = true;

            #endregion
        }
示例#2
0
文件: Home.cs 项目: lmorisse/Symu
        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
        }
示例#3
0
        private void LoadSettings()
        {
            DisplayButtons();

            tbWorkers.Text             = _mainOrganization.WorkersCount.ToString(CultureInfo.InvariantCulture);
            tbKnowledge.Text           = _mainOrganization.KnowledgeCount.ToString(CultureInfo.InvariantCulture);
            cbMultipleBlockers.Checked = _mainOrganization.Murphies.MultipleBlockers;
            KnowledgeLevel.Items.AddRange(KnowledgeLevelService.GetNames());
            KnowledgeLevel.SelectedItem = KnowledgeLevelService.GetName(_mainOrganization.KnowledgeLevel);
            BeliefsLevel.Items.AddRange(BeliefLevelService.GetNames());
            BeliefsLevel.SelectedItem = BeliefLevelService.GetName(_mainOrganization.Templates.Human.Cognitive
                                                                   .KnowledgeAndBeliefs.DefaultBeliefLevel);
            EmailComm.Checked = true;

            #region unavaibility

            tbUnavailabilityThreshold.Text =
                _mainOrganization.Murphies.UnAvailability.RateOfUnavailability.ToString(CultureInfo.InvariantCulture);
            UnavailabilityRate.Text =
                _mainOrganization.Murphies.UnAvailability.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);

            #endregion

            #region incomplete knowledge murphy

            tbKnowledgeThreshHoldForDoing.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.ThresholdForReacting.ToString(CultureInfo
                                                                                             .InvariantCulture);
            tbLackRateOfIncorrectGuess.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.RateOfIncorrectGuess.ToString(CultureInfo
                                                                                             .InvariantCulture);
            tbLackRateOfAnswers.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.RateOfAnswers.ToString(CultureInfo.InvariantCulture);
            tbLackResponseTime.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.ResponseTime.ToString(CultureInfo.InvariantCulture);
            cbLimitNumberOfTriesKnowledge.Checked =
                _mainOrganization.Murphies.IncompleteKnowledge.LimitNumberOfTries != -1;
            tbMaxNumberOfTriesKnowledge.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.LimitNumberOfTries.ToString(
                    CultureInfo.InvariantCulture);
            tbLackDelayBeforeSearchingExternally.Text = _mainOrganization.Murphies.IncompleteKnowledge
                                                        .DelayBeforeSearchingExternally.ToString(CultureInfo.InvariantCulture);
            tbRequiredMandatoryRatio.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.MandatoryRatio.ToString(CultureInfo.InvariantCulture);

            KnowledgeRate.Text =
                _mainOrganization.Murphies.IncompleteKnowledge.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);
            EmailSearching.Checked = _mainOrganization.Models.Learning.On;

            #endregion

            #region incomplete belief murphy

            BeliefsRate.Text =
                _mainOrganization.Murphies.IncompleteBelief.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);
            tbBeliefRateIncorrectGuess.Text =
                _mainOrganization.Murphies.IncompleteBelief.RateOfIncorrectGuess
                .ToString(CultureInfo.InvariantCulture);
            tbBeliefRateAnswers.Text =
                _mainOrganization.Murphies.IncompleteBelief.RateOfAnswers.ToString(CultureInfo.InvariantCulture);
            tbBeliefResponseTime.Text =
                _mainOrganization.Murphies.IncompleteBelief.ResponseTime.ToString(CultureInfo.InvariantCulture);
            cbLimitNumberOfTriesBelief.Checked = _mainOrganization.Murphies.IncompleteBelief.LimitNumberOfTries != -1;
            tbMaxNumberOfTriesBelief.Text      =
                _mainOrganization.Murphies.IncompleteBelief.LimitNumberOfTries.ToString(CultureInfo.InvariantCulture);
            BeliefsRiskAversion.Text =
                _mainOrganization.Murphies.IncompleteBelief.ThresholdForReacting
                .ToString(CultureInfo.InvariantCulture);

            #endregion

            #region incomplete information murphy

            InformationRateAgentsOn.Text =
                _mainOrganization.Murphies.IncompleteInformation.RateOfAgentsOn.ToString(CultureInfo.InvariantCulture);
            InformationRateOfIncorrectGuess.Text =
                _mainOrganization.Murphies.IncompleteInformation.RateOfIncorrectGuess.ToString(CultureInfo
                                                                                               .InvariantCulture);
            InformationRateOfAnswer.Text =
                _mainOrganization.Murphies.IncompleteInformation.RateOfAnswers.ToString(CultureInfo.InvariantCulture);
            InformationResponseTime.Text =
                _mainOrganization.Murphies.IncompleteInformation.ResponseTime.ToString(CultureInfo.InvariantCulture);
            InformationLimitOfTries.Checked =
                _mainOrganization.Murphies.IncompleteInformation.LimitNumberOfTries != -1;
            InformationMaxOfTries.Text =
                _mainOrganization.Murphies.IncompleteInformation.LimitNumberOfTries.ToString(CultureInfo
                                                                                             .InvariantCulture);
            InformationThreshold.Text =
                _mainOrganization.Murphies.IncompleteInformation.ThresholdForReacting.ToString(CultureInfo
                                                                                               .InvariantCulture);

            #endregion

            foreach (ListViewItem item in lvMurphies.Items)
            {
                switch (item.Text)
                {
                case "Incomplete information":
                    gbInformation.Visible = _mainOrganization.Murphies.IncompleteInformation.On;
                    item.Checked          = _mainOrganization.Murphies.IncompleteInformation.On;
                    break;

                case "Changing Information":
                    //item.Checked = murphies.ChangingInformation.On;
                    break;

                case "Incorrectness information":
                    //item.Checked = murphies.IncorrectInformation.On;
                    break;

                case "Communication breakdowns":
                    //item.Checked = murphies.CommunicationBreakDown.On;
                    break;

                case "Agent unavailability":
                    gbBelief.Visible = _mainOrganization.Murphies.UnAvailability.On;
                    item.Checked     = _mainOrganization.Murphies.UnAvailability.On;
                    break;

                case "Incomplete knowledge":
                    gbUncompleteKnowledge.Visible = _mainOrganization.Murphies.IncompleteKnowledge.On;
                    item.Checked = _mainOrganization.Murphies.IncompleteKnowledge.On;
                    break;

                case "Incomplete belief":
                    gbBelief.Visible = _mainOrganization.Murphies.IncompleteBelief.On;
                    item.Checked     = _mainOrganization.Murphies.IncompleteBelief.On;
                    break;
                }
            }
        }