Beispiel #1
0
        private void update()
        {
            if (this.protoActivity_database.Count < 3)
            {
                HelpWindowBuilder builder = new HelpWindowBuilder();
                int numMissing            = 3 - this.protoActivity_database.Count;
                if (this.protoActivity_database.Count > 0)
                {
                    builder.AddMessage("Not enough protoactivities! Still need " + numMissing + " more.");
                }

                builder.AddMessage("This screen will allow you to browse your ProtoActivities once you enter some.")
                .AddMessage("A ProtoActivity is a note where you brainstorm ideas, and which you may later promote into an Activity if you like.")
                .AddMessage("While you browse ProtoActivities in this screen, you will compare which ones you like more and which ones you like less " +
                            "(you will still be able to edit them, too). This allows ActivityRecommender to show you ideas that you like more often.")
                .AddMessage("This is a super easy way to save hundreds of ideas for later!")
                .AddMessage("To create a ProtoActivity, go back to the previous screen.");
                this.SubLayout = builder.Build();
            }
            else
            {
                List <ProtoActivity_EstimatedInterest> top_protoActivities = this.protoActivity_database.GetMostInteresting(2);
                this.SubLayout = this.multiActivitiesLayout;
                double numProtos = this.protoActivity_database.Count;
                this.titleLayout.setText("Protoactivity Tournament: compare 2");
                this.titleLayout.AlignHorizontally(TextAlignment.Center);

                int    numBrowses           = this.computeNumBrowses();
                double numBrowsesPerProto   = numBrowses / numProtos;
                string browsesPerProto_text = Math.Round(numBrowsesPerProto, 3).ToString();
                this.numBrowsesPerProtoactivity_Layout.setText(browsesPerProto_text + " browses per proto\n(" + numBrowses + " browses,\n" + numProtos + " protos)");

                this.setActivity1(top_protoActivities[0]);
                this.setActivity2(top_protoActivities[1]);
            }
        }
        public ExperimentResultsView(Participation participation)
        {
            HelpWindowBuilder builder = new HelpWindowBuilder();

            PlannedExperiment             experiment = participation.RelativeEfficiencyMeasurement.Experiment;
            RelativeEfficiencyMeasurement earlier    = experiment.FirstParticipation.RelativeEfficiencyMeasurement;
            RelativeEfficiencyMeasurement later      = experiment.SecondParticipation.RelativeEfficiencyMeasurement;
            string earlierName = earlier.ActivityDescriptor.ActivityName;
            string laterName   = later.ActivityDescriptor.ActivityName;

            builder.AddMessage("In your experiment at " + earlier.StartDate + ", you agreed to several choices, including:");
            builder.AddMessage("A: " + earlierName);
            builder.AddMessage("B: " + laterName);

            double difficultyRatio = experiment.Earlier.DifficultyEstimate.EstimatedSuccessesPerSecond / experiment.Later.DifficultyEstimate.EstimatedSuccessesPerSecond;

            builder.AddMessage("You predicted that B would be " + this.round(difficultyRatio) + " times as difficult as A.");

            TimeSpan earlierDuration = earlier.EndDate.Subtract(earlier.StartDate);
            double   earlierMinutes  = earlierDuration.TotalMinutes;
            TimeSpan laterDuration   = later.EndDate.Subtract(later.StartDate);
            double   laterMinutes    = laterDuration.TotalMinutes;

            double earlierHelpFraction    = experiment.FirstParticipation.HelpFraction;
            string earlierHelpDescription = "";

            if (earlierHelpFraction > 0)
            {
                earlierHelpDescription = " with help, and you personally completed " + this.round(1 - earlierHelpFraction) + " of it";
            }
            builder.AddMessage("Then, you spent " + this.round(earlierDuration.TotalMinutes) + "m on A" + earlierHelpDescription);

            double laterHelpFraction    = experiment.SecondParticipation.HelpFraction;
            string laterHelpDescription = "";

            if (laterHelpFraction > 0)
            {
                laterHelpDescription = " with help, and you personally completed " + this.round(1 - laterHelpFraction) + " of it";
            }
            builder.AddMessage("Later, you spent " + this.round(laterDuration.TotalMinutes) + "m on B at " + later.StartDate + laterHelpDescription);

            double earlierTotalEffectiveness = earlier.RecomputedEfficiency.Mean * earlierMinutes / (1 - earlierHelpFraction);
            double laterTotalEffectiveness   = later.RecomputedEfficiency.Mean * laterMinutes / (1 - laterHelpFraction);

            string earlierHelpDivision = "";

            if (earlierHelpFraction > 0)
            {
                earlierHelpDivision = " / " + this.round(1 - earlierHelpFraction);
            }
            builder.AddMessage("I estimated that your efficiency on A would be about " + this.round(earlier.RecomputedEfficiency.Mean) +
                               ", making the difficulty of A be " + this.round(earlier.RecomputedEfficiency.Mean) + " * " + this.round(earlierMinutes) + "m" + earlierHelpDivision + " = " +
                               this.round(earlierTotalEffectiveness) + "m");

            builder.AddMessage("So, the difficulty of B should be " + this.round(earlierTotalEffectiveness) + "m * "
                               + this.round(difficultyRatio) + " = " + this.round(laterTotalEffectiveness) + "m");

            string laterHelpDivision = "";

            if (laterHelpFraction > 0)
            {
                laterHelpDivision = " / " + this.round(1 - laterHelpFraction);
            }
            builder.AddMessage("And your efficiency on B should be " + this.round(laterTotalEffectiveness) + "m / " +
                               this.round(laterMinutes) + "m" + laterHelpDivision + " = " + this.round(later.RecomputedEfficiency.Mean));

            builder.AddMessage("Isn't that interesting?");

            this.SubLayout = builder.Build();
        }