/// <summary>
        /// Return the Name of this experiment item, used for labelling and indexing for items
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string            currentExperimentItemName = "";
            ExperimentSetting currentExperimentSetting  = MainPage.mainPageForm.currentExperimentSetting;

            //Only display the runType name of this experiment model,  when the experiment is Batch Running
            if (currentExperimentSetting.experimentType == ExperimentType.BatchRunning)
            {
                return(GetRunTypeString());
            }

            //Display both runType and taskSelectionMethod of the current experiment model, for other types of experiments
            currentExperimentItemName = GetRunTypeString() + ":" + Enum.GetName(typeof(TaskSelectionMethod), taskSelectionMethod) + "_" + Enum.GetName(typeof(WorkerSelectionMethod), WorkerSelectionMethod);

            return(currentExperimentItemName);
        }
        /// <summary>
        /// Restore to set previous experiment setting
        /// </summary>
        /// <param name="exprSetting"></param>
        public void setPreviousExperimentSetting(ExperimentSetting exprSetting)
        {
            currentListOfExperimentModels = new List <ExperimentModel>();
            dataGridViewOfCurrentModels.Rows.Clear();
            comboBoxForSelectingDataset.SelectedIndex = GlobalVariables.getDatasetIndex(exprSetting.currentDataset);

            //for each experimentItem in the experimentSetting
            for (int i = 0; i < exprSetting.GetNumberOfExperiemntModels(); i++)
            {
                ExperimentModel currentExperimentItem = exprSetting.GetExperimentModel(i);

                //add to the experimentList
                currentListOfExperimentModels.Add(currentExperimentItem);
                //add to the grid view
                Object[] tempRow = { currentExperimentItem.runType, currentExperimentItem.taskSelectionMethod, currentExperimentItem.WorkerSelectionMethod };
                dataGridViewOfCurrentModels.Rows.Add(tempRow);
            } //End for
        }
        /// <summary>
        /// Restore to set previous experiment setting
        /// </summary>
        /// <param name="exprSetting"></param>
        public void setPreviousExperimentSetting(ExperimentSetting exprSetting)
        {
            currentListOfExperimentModels = new List<ExperimentModel>();
            dataGridViewOfCurrentModels.Rows.Clear();
            comboBoxForSelectingDataset.SelectedIndex = GlobalVariables.getDatasetIndex(exprSetting.currentDataset);

            //for each experimentItem in the experimentSetting
            for (int i = 0; i < exprSetting.GetNumberOfExperiemntModels(); i++)
            {
                ExperimentModel currentExperimentItem = exprSetting.GetExperimentModel(i);
                
                //add to the experimentList
                currentListOfExperimentModels.Add(currentExperimentItem);
                //add to the grid view
                Object[] tempRow = { currentExperimentItem.runType, currentExperimentItem.taskSelectionMethod, currentExperimentItem.WorkerSelectionMethod };
                dataGridViewOfCurrentModels.Rows.Add(tempRow);

            } //End for

        }
Пример #4
0
        /// <summary>
        /// Create an ExperimentSetting instance for the selected dataset
        /// </summary>
        /// <param name="datasetPath">the dataset path going to examine</param>
        /// <param name="totalLabellingRound">the total number of labelling round</param>
        /// <pa
        /// ram name="currentTaskSelectionMethods">An array containing the selected task selection methods from user</param>
        /// <param name="currentRunTypes">An array containing the selected run types from user</param>
        /// <param name="mabConstant">The mab constant value for the EntropyMABTask</param>
        public void SetNewExperimentSettings(Dataset currentDataset, int totalLabellingRound, List<ExperimentModel> experimentItemList, ExperimentType experimentType, int numberOfIterations = 1)
        {
            currentExperimentSetting = new ExperimentSetting(totalLabellingRound, currentDataset, experimentType, numberOfIterations);

            if (totalLabellingRound > 1) 
            {
                if (experimentItemList.Count == 1) 
                {
                    currentExperimentSetting.numberOfLabellingRound = experimentItemList[0].numberOfLabellingRound;
                }
            }
            for (int i = 0; i < experimentItemList.Count; i++)
            {
                currentExperimentSetting.AddExperimentModel(experimentItemList[i]);
            }
            InitialiseActiveLearningExperiment();
        }