Exemplo n.º 1
0
            public IResult[] Execute(ITimes times, IParallelism parallelism)
            {
                IInstance[] input = this.instances;

                while (true)
                {
                    Log.Information("Executing {Case} {Times}", [email protected], times.Describe());

                    MinDurationVisitor visitor = new MinDurationVisitor();
                    IResult[]          results = parallelism.Execute(input, times);

                    foreach (IResult result in results)
                    {
                        result.Data.Visit(visitor);
                    }

                    if (visitor.HasValue() == false || visitor.GetValue().TotalSeconds >= 1.0d)
                    {
                        return(results);
                    }

                    double ceiling = Math.Ceiling(1.2d / visitor.GetValue().TotalSeconds);
                    times = times.Multiply(Math.Max(2, (int)ceiling));
                    input = OptimizeOrder(results);
                }
            }
Exemplo n.º 2
0
            public IResult[] Execute(ITimes times, IParallelism parallelism)
            {
                IInstance[] input = this.instances;

                while (true)
                {
                    Log.Information("Executing {Case} {Times}", [email protected], times.Describe());

                    MinDurationVisitor visitor = new MinDurationVisitor();
                    IResult[] results = parallelism.Execute(input, times);

                    foreach (IResult result in results)
                    {
                        result.Data.Visit(visitor);
                    }

                    if (visitor.HasValue() == false || visitor.GetValue().TotalSeconds >= 1.0d)
                    {
                        return results;
                    }

                    double ceiling = Math.Ceiling(1.2d / visitor.GetValue().TotalSeconds);
                    times = times.Multiply(Math.Max(2, (int)ceiling));
                    input = OptimizeOrder(results);
                }
            }
 public ITimes Multiply(ITimes times)
 {
     return(times.Multiply(20000));
 }