コード例 #1
0
        public BettingActor GenerateBettingActor(int outputs)
        {
            var actor    = BettingActor.GetBestGuessBettingActor();
            var numRules = ResolveAttribute(NumRules);

            for (var i = 0; i < numRules; i++)
            {
                var wager     = ResolveAttribute(Wagers[i]);
                var threshold = ResolveAttribute(Thresholds[i]);
                var rule      = new BettingRule()
                {
                    Priority  = i,
                    Wager     = wager,
                    Threshold = threshold
                };
                actor.Rules.Add(rule);
            }

            return(actor);
        }
コード例 #2
0
        public static BettingActor GenerateRandomActor(Random random)
        {
            var representative = BettingActor.GetBestGuessBettingActor();
            var numRules       = random.Next(MinNumRules, MaxNumRules);

            for (var i = 0; i < numRules; i++)
            {
                var wager     = Numbery.Normalise(random.NextDouble(), 0, 1, MinWager, MaxWager);
                var threshold = Numbery.Normalise(random.NextDouble(), 0, 1, MinThreshold, MaxThreshold);
                var rule      = new BettingRule()
                {
                    Priority  = i,
                    Wager     = wager,
                    Threshold = threshold
                };
                representative.Rules.Add(rule);
            }

            return(representative);
        }