Beispiel #1
0
        public static double MonteCarlo(AttackPattern toSimulate, StatsGroup stats, double duration, int count)
        {
            double total = 0;

            double[] results = new double[count];
            Parallel.For(0, count, i =>
            {
                SimpleSimulator sim = new SimpleSimulator();
                results[i]          = sim.Simulate(toSimulate, stats, duration);
            });
            for (int i = 0; i < count; ++i)
            {
                //results[i] = Simulate(toSimulate, stats, duration);
                total += results[i];
            }
            return(total / count);
        }
Beispiel #2
0
 public SimulatedAttackPattern(AttackPattern toSimulate, StatsGroup stats, SimpleSimulator sim)
 {
     this.ToSimulate = toSimulate;
     this.Stats      = stats;
     this.Sim        = sim;
 }
Beispiel #3
0
        public double Simulate(AttackPattern toSimulate, StatsGroup stats, double duration)
        {
            SimulatedAttackPattern simulated = new SimulatedAttackPattern(toSimulate, stats, this);

            return(simulated.SimulateTotalPotencyOver(duration));
        }