コード例 #1
0
ファイル: PreflopBetModel.cs プロジェクト: ddksaku/rzr
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="table">The table upon which the players for this scenario are seated</param>
 /// <param name="round">The current round of betting</param>
 /// <param name="policy">Policy information dictating what the player can and can't do</param>
 public PreflopBetModel(PlayerModel player, HoldemHandRound round, BetTypeModel betType)
     : base(betType)
 {
     Player = player;
     Round = round;
     Icon = Utilities.LoadBitmap(Properties.Resources.PreflopBetIcon);
     Range = new HandRangeModel();
     InfoDisplayType = typeof(BetTreeNodeInfo);
 }
コード例 #2
0
ファイル: HandRangeEditor.xaml.cs プロジェクト: ddksaku/rzr
 protected void SetModel(object sender, DependencyPropertyChangedEventArgs e)
 {
     _model = DataContext as HandRangeModel;
     Initialise();
 }
コード例 #3
0
ファイル: ConditionService.cs プロジェクト: ddksaku/rzr
        public void Distribute(List<CompiledCondition> conditions, HandRangeModel range, int numIterations)
        {
            RangeCalculatorService service = new RangeCalculatorService();
            HandMask[][][] masks = service.Calculate(new HandRange[] { range.Range }, new Card[] { null, null, null, null, null },
                numIterations, new bool[] { true, false, false });

            int[] hits = new int[conditions.Count];
            for (int i = 0; i < numIterations; i++)
            {
                HandMask mask = masks[i][0][0];
                int index = 0;
                foreach (CompiledCondition container in conditions)
                {
                    if (container.Matches(mask))
                    {
                        hits[index]++;
                        break;
                    }
                    index++;
                }
            }

            for (int i = 0; i < this.Definition.ConfiguredConditions.Count; i++)
            {
                this.Definition.ConfiguredConditions[i].ExpectedProbability = 0;
            }

            for (int i = 0; i < hits.Length; i++)
            {
                conditions[i].Container.ExpectedProbability = (float)hits[i] / numIterations;
            }
        }
コード例 #4
0
ファイル: ConditionSelectorModel.cs プロジェクト: ddksaku/rzr
        public void Distribute(float rangeFactor, float variationFactor)
        {
            HandRangeModel range = new HandRangeModel();
            range.RangePercentage = rangeFactor;
            range.VariationFactor = variationFactor;

            List<CompiledCondition> conditions = Service.GetCompiledConditions(
                this.Conditions.Where(x => x.IsSelected).Select(x => x.Condition).ToList());
            Service.Distribute(conditions, range, 5000);

            foreach (AvailableConditionListingModel listing in this.Conditions)
                listing.Probability = String.Format("{0:0.00}%", listing.Condition.ExpectedProbability * 100);
        }