private void computeOptimalStrategy(double aggressiveness) { if (strategyEvaluator == null) return; currentOptimalStrategy = strategyEvaluator.GetBestStrategyWithConstraints(currentConstraint, aggressiveness); currentExpectedDrinks = strategyEvaluator.GetExpectedDrinks(currentOptimalStrategy); if (currentConstraint.AreAllNull()) { currentUnconstrainedStrategy = currentOptimalStrategy; currentUnconstrainedDrinks = currentExpectedDrinks; } bool isAlwaysOptimal = IsCurrentOptimalStable() && (currentConstraint.IsSatisfiedBy(currentUnconstrainedStrategy)); if (currentConstraint.AreAllNull()) { isUnconstrainedAlwaysOptimal = isAlwaysOptimal; } paintStrategy(currentOptimalStrategy, isAlwaysOptimal); }
private ExpectedDrinks GetStrategyDrinks(Strategy strategy) { ExpectedDrinks drinks = new ExpectedDrinks(strategy.GetExpectedUserDrinks(likelihoods), strategy.GetExpectedDealerDrinks(likelihoods)); drinks.ComputeConditionalDrinks(strategy, likelihoods); return drinks; }