Example #1
0
        /// <summary>
        ///  Example: compare Group-centric Matcher with matcher implementations of TeamMaker and Omado Genesis with one heterogeneous criterion as e.g. in a similar way used for publication
        ///  Konert, J.; Burlak, D.; Göbel, S.; Steinmetz, R.: GroupAL: ein Algorithmus zur Formation und Qualitätsbewertung von Lerngruppen in E-Learning-Szenarien mittels n-dimensionaler Gütekriterien. In: Proceedings of the DeLFI 2013: Die 11. e-Learning Fachtagung Informatik der Gesellschaft für Informatik e.V. (Hrsg. Breitner, A.; C. Rensing) (pp. 71–82). Bremen, Germany: Köllen, 2013.
        ///  or more detailed in
        ///  Konert, J.; Burlak, D.; Göbel, S.; Steinmetz, R.: GroupAL: ein Algorithmus zur Formation und Qualitätsbewertung von Lerngruppen in E-Learning-Szenarien. i-com , 13(1) (2014), 70–81 doi:10.1515/icom-2014-0010
        /// </summary>
        /// <param name="runs">number of runs to repeat (each with 500 new participants generated)</param>

        internal void TaskRunCompareMatchersGcmOmadoTeammaker1HetCrit(int runs)
        {
            TextFileCohortReaderWriter CohortWriter = new TextFileCohortReaderWriter();
            IRule  rule = new TeamMakerRule();
            int    CountOfPraticipants = 500;
            int    GroupSize           = 3;
            string fileName            = "TaskRunCompareMatchers_" + (rule == null ? "nR" : "R") + "_" + GroupSize + "G_1K.csv";
            string output = "";

            CohortWriter.WriteTemporaryResultsToFile("CohortAveragePerformance" + separator + "CohortPerformanceIndex" + separator + "Matcher" + newLine, fileName, true);
            for (int i = 0; i < runs; i++)
            {
                participants = ParticipantGenerator.DummyEntries(CountOfPraticipants, rule);
                //participants = ParticipantGenerator.PerfectDummyEntries();


                GroupFormationAlgorithm gfTM = new GroupFormationAlgorithm(participants, new TeamMakerMatcher(), new TeamMakerEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                gfTM.DoOneFormation();

                GroupFormationAlgorithm gfGcM = new GroupFormationAlgorithm(participants, new GroupALGroupCentricMatcher(), new GroupALEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                gfGcM.DoOneFormation();

                //omadogenesis is Random
                GroupFormationAlgorithm gfRandom = new GroupFormationAlgorithm(participants, new RandomMatcher(), new GroupALEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                gfRandom.DoOneFormation();

                output  = (gfTM.Cohort.results.avg + separator + gfTM.Cohort.results.performanceIndex + separator + gfTM.Cohort.whichMatcherUsed).Replace(",", ".") + newLine;
                output += (gfGcM.Cohort.results.avg + separator + gfGcM.Cohort.results.performanceIndex + separator + gfGcM.Cohort.whichMatcherUsed).Replace(",", ".") + newLine;
                output += (gfRandom.Cohort.results.avg + separator + gfRandom.Cohort.results.performanceIndex + separator + gfRandom.Cohort.whichMatcherUsed).Replace(",", ".") + newLine;

                CohortWriter.WriteTemporaryResultsToFile(output, fileName, false);
            }
        }
Example #2
0
        /// <summary>
        /// Example method evaluating optimization cycles of different matchers with 100 generated dummy participants
        /// </summary>
        public void TaskRunCompareMatchersOptimization()
        {
            GroupFormationAlgorithm    gf;
            TextFileCohortReaderWriter CohortWriter = new TextFileCohortReaderWriter();
            string filename = "ExampleOptimizationProcessForeachMatcher.csv";
            // columns header of CSV file
            string output = "MatcherName" + separator + "Cycle" + separator + "CohortPerformanceIndex" + separator + "CohortAverage" + separator + "OptimizationCount" + newLine;

            CohortWriter.WriteTemporaryResultsToFile(output, filename, true);

            List <IMatcher> matchers = new List <IMatcher> {
                new GroupALGroupCentricMatcher(), new GroupALParticipantCentricMatcher(), new RandomMatcher()
            };

            int GroupSize            = 6;
            int cycles               = 10;
            int CountOfOptimizations = 5;

            for (int i = 0; i < cycles; i++)
            {
                participants = ParticipantGenerator.DummyEntries(100);
                foreach (IMatcher matcher in matchers)
                {
                    gf = new GroupFormationAlgorithm(participants, matcher, new GroupALEvaluator(), new GroupALOptimizer(matcher), GroupSize);
                    gf.DoOneFormation();

                    for (int j = 0; j < CountOfOptimizations; j++)
                    {
                        if (j == 0)
                        {
                            output = gf.Cohort.whichMatcherUsed + separator + i + separator + gf.Cohort.results.performanceIndex + separator + gf.Cohort.results.avg + separator + j + newLine;
                            CohortWriter.WriteTemporaryResultsToFile(output.Replace(",", replacementForNumberComma), filename, false);
                            continue;
                        }
                        gf.OptimizeCohort();
                        output = gf.Cohort.whichMatcherUsed + separator + i + separator + gf.Cohort.results.performanceIndex + separator + gf.Cohort.results.avg + separator + j + newLine;
                        CohortWriter.WriteTemporaryResultsToFile(output.Replace(",", replacementForNumberComma), filename, false);
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// This is a specific evaluation data generation method used to create
        /// - 2 sets of data (one set with only one homogeneous criterion with 4 dimensions, one set with 2 homogeneous and 2 heterogeous matching criteria, each with 4 dimensions)
        /// - each set in three variations (data distribution uniformly (all values 0..1 have same possibility, gausian values between 0..1, and only extreme values (0,1))
        /// - the 6 combinations of sets (S) and variances (V) are all generated 100 times for 500 participants
        /// - automatically named and stored
        ///
        /// Data created with this method has been used to compare the different matchers implemented in namespace GroupAL.Matcher, e.g. to be published in
        /// Konert, J.: Interactive Multimedia Learning: Using Social Media for Peer Education in Single-Player Educational Games (accepted for publication). Technische Universität Darmstadt, Germany 2014.
        /// </summary>
        private void generateDummyParticipants()
        {
            IParticipantReaderWriter tw = new TextFileParticipantReaderWriter();

            for (int i = 0; i < 2; i++)
            {// 2 sets
                int numhet = 1;
                int dimhet = 4;
                int numhom = 0;
                int dimhom = 4;
                if (i == 1)
                {
                    numhet = 2;
                    numhom = 2;
                }
                for (int j = 0; j < 3; j++)
                {// 3 variations
                    IRule           rule   = new EmptyRule();
                    IValueGenerator valgen = new UniformValueGenerator();
                    if (j == 1)
                    {
                        valgen = new GaussianValueGenerator();
                    }
                    if (j == 2)
                    {
                        rule = new TeamMakerRule(); // builds 1 and 0 (extreme) values. Only ~one~ 1 for heterogeneous criteria, several 1s for homogeneous criteria
                    }
                    for (int k = 1; k <= 100; k++)  // number of rounds to do it. (100 evaluation runs)
                    {
                        String filename = ".\\data\\GroupALParticipantsSet" + (i + 1) + "V" + (j + 1) + "_" + k + ".csv";
                        //String filename = "GroupALParticipantsN"+amount+"Het"+numHet+"Dim"+hetDim+"Hom"+numHom+"Dim"+homDim+".csv";
                        // set here number of participants (500)
                        ParticipantGenerator gen = new ParticipantGenerator(500, numhet, dimhet, numhom, dimhom, valgen, rule, tw, filename);
                    }
                }
            }
        }
Example #4
0
        /// <summary>
        /// Example method comparing comutation time for different matchers
        /// </summary>
        public void TaskRunCompareMatchersRuntime()
        {
            TextFileCohortReaderWriter CohortWriter = new TextFileCohortReaderWriter();

            string filename = "ExampleTimeComparisonBetweenMatcher.csv";
            // columns header of CSV file
            string output = "MatcherName" + separator + "countOfParticipants" + separator + "TimeNeeded" + newLine;

            CohortWriter.WriteTemporaryResultsToFile(output, filename, true);
            for (int i = 0; i < 3; i++)
            {
                participants = ParticipantGenerator.DummyEntries((i == 0 ? 100 : i * 500));

                GroupFormationAlgorithm gf = new GroupFormationAlgorithm(participants, new GroupALParticipantCentricMatcher(), new GroupALEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                sw.Start();
                gf.DoOneFormation();
                sw.Stop();
                output = gf.Cohort.whichMatcherUsed + separator + participants.Count + separator + sw.ElapsedMilliseconds + newLine;


                GroupFormationAlgorithm gfGbG = new GroupFormationAlgorithm(participants, new GroupALGroupCentricMatcher(), new GroupALEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                sw.Restart();
                gfGbG.DoOneFormation();
                sw.Stop();
                output += gfGbG.Cohort.whichMatcherUsed + separator + participants.Count + separator + sw.ElapsedMilliseconds + newLine;


                GroupFormationAlgorithm gfRandom = new GroupFormationAlgorithm(participants, new RandomMatcher(), new GroupALEvaluator(), new GroupALOptimizer(new GroupALGroupCentricMatcher()), GroupSize);
                sw.Restart();
                gfRandom.DoOneFormation();
                sw.Stop();
                output += gfRandom.Cohort.whichMatcherUsed + separator + participants.Count + separator + sw.ElapsedMilliseconds + newLine;

                CohortWriter.WriteTemporaryResultsToFile(output.Replace(",", replacementForNumberComma), filename, false);
            }
        }
Example #5
0
 public List <Participant> generateNewDummyEntries()
 {
     participants = ParticipantGenerator.DummyEntries(CountofEntries);
     return(participants);
 }