Ejemplo n.º 1
0
        public SimulationResult(
            ControllerSettings controllerSettings,
            ControllerResults controllerResults,
            Player player,
            int initialWallet)
        {
            ControllerSettings = controllerSettings;
            TotalLoss          = player.TotalLost;
            TotalWage          = player.TotalWage;
            TotalWin           = player.TotalEarn;
            Benefits           = player.Benefits;
            WinRate            = player.WinRate;
            Roi           = player.Roi;
            GamesPlayed   = player.GamesCount;
            InitialWallet = initialWallet;
            FinalWallet   = player.Wallet;

            MaxConsecutiveLoss = controllerResults.MaxConsecutiveLoss;
            MaxCashLoss        = controllerResults.MaxCashLoss;
            MaxWage            = controllerResults.MaxWage;
            MaxWallet          = controllerResults.MaxWallet;
            MaxCashLoss        = controllerResults.MaxCashLoss;
            MinWallet          = controllerResults.MinWallet;

            ComputeScores();
        }
Ejemplo n.º 2
0
        static async Task MainAsync()
        {
            int initialWallet    = 45000;
            var results          = new ConcurrentDictionary <ControllerSettings, Player>();
            var simulationRunner = new SimulationRunner();
            var games            = await simulationRunner.LoadGames(new DateTime(2018, 09, 13, 22, 30, 0), new DateTime(2018, 09, 14, 6, 30, 0)).ConfigureAwait(false);

            games            = games.OrderBy(g => g.Id).ToList();
            simulationRunner = new SimulationRunner();
            var player = new Player()
            {
                Wallet = initialWallet
            };

            var controllerSettings = new ControllerSettings()
            {
                BaseBet    = 4,
                Multiplier = 2.09,
                PassGames  = 7,
                Reducer    = 0.001,
                Target     = 7
            };

            var controller = new RouletteController(
                player, controllerSettings.BaseBet,
                controllerSettings.Target,
                controllerSettings.Multiplier,
                controllerSettings.PassGames,
                controllerSettings.Reducer);

            simulationRunner.StartWith(player, controller, games);
            player.ComputeStats();
            player.ControllerResults = controller.ToString();
            var controllerResults = controller.GetControllerResults();

            var simulationResult = new SimulationResult(controllerSettings, controllerResults, player, initialWallet);

            results.TryAdd(controllerSettings, player);
            Console.WriteLine(player);
            Console.WriteLine(controller);
            Console.WriteLine(simulationResult);
        }