Example #1
0
        private void Suggest(ActivityRequestOptimizationProperty optimizationProperty)
        {
            ActivityRequest activityRequest = new ActivityRequest(this.categoryBox.Activity, this.atLeastAsFunAs_activity, DateTime.Now, optimizationProperty);

            activityRequest.NumOptionsRequested = this.numChoicesPerSuggestion;
            if (this.atLeastAsFunAs_activity != null)
            {
                DateTime      startDate                 = activityRequest.Date;
                DateTime      hypotheticalEndDate       = this.engine.GuessParticipationEndDate(this.atLeastAsFunAs_activity, startDate);
                Participation hypotheticalParticipation = new Participation(startDate, hypotheticalEndDate, activityRequest.ActivityToBeat);
                hypotheticalParticipation.Hypothetical = true;

                Rating userPredictedRating = this.specify_AtLeastAsFunAs_Layout.EstimatedRating_Box.GetRelativeRating(this.engine, hypotheticalParticipation);
                activityRequest.UserPredictedRating = userPredictedRating;
            }
            this.RequestSuggestion.Invoke(activityRequest);
        }
 public ActivityRequest(Activity fromCategory, Activity activityToBeat, DateTime when, ActivityRequestOptimizationProperty optimize = ActivityRequestOptimizationProperty.LONGTERM_HAPPINESS)
 {
     if (fromCategory != null)
     {
         this.FromCategory = fromCategory.MakeDescriptor();
     }
     if (activityToBeat != null)
     {
         this.ActivityToBeat = activityToBeat.MakeDescriptor();
     }
     this.Date     = when;
     this.Optimize = optimize;
 }