예제 #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);
        }
예제 #2
0
 public SimulatedAttackPattern(AttackPattern toSimulate, StatsGroup stats, SimpleSimulator sim)
 {
     this.ToSimulate = toSimulate;
     this.Stats      = stats;
     this.Sim        = sim;
 }
예제 #3
0
        public double Simulate(AttackPattern toSimulate, StatsGroup stats, double duration)
        {
            SimulatedAttackPattern simulated = new SimulatedAttackPattern(toSimulate, stats, this);

            return(simulated.SimulateTotalPotencyOver(duration));
        }