Ejemplo n.º 1
0
        private static void Compute <TF>(AlgorithmOptions options, bool useCache = true) where TF : IFunction, new()
        {
            var function = useCache ? (IFunction) new Cached <TF>() : new TF();
            var solved   = new Algorithm(options).Execute(function);
            var result   = BinaryConvertor.BinaryStringToInts(solved);

            Console.WriteLine($"Computed {function.GetType()}: {string.Join(", ", result)}");
        }
Ejemplo n.º 2
0
 public Algorithm(Random random, AlgorithmOptions options)
 {
     _random  = random;
     _options = options;
 }
Ejemplo n.º 3
0
 public Algorithm(AlgorithmOptions options) : this(new Random(), options)
 {
 }