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); }
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); }