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)}"); }
public Algorithm(Random random, AlgorithmOptions options) { _random = random; _options = options; }
public Algorithm(AlgorithmOptions options) : this(new Random(), options) { }