Example #1
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 #2
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
        }