public virtual int?TrySolve(CPUProblem p) { if (threads >= p.RequiredThreads) { Console.WriteLine("Problem {0} - solved with CPU {1}", p.Name, model); return(p.Computation()); } Console.WriteLine("Problem {0} - failed to solve with CPU {1}", p.Name, model); return(null); }
public int?CanSolve(CPUProblem p) { if (p.RequiredThreads <= this.threads) { SolvingInfo.Solved(this.model, p.Name); return(p.Computation()); } SolvingInfo.NotSolved(this.model, p.Name); return(null); }
public int?Visit(CPUProblem cPUProblem) { if (this.threads >= cPUProblem.RequiredThreads) { System.Console.WriteLine($"{this.model} resolved the problem"); return(cPUProblem.Computation()); } System.Console.WriteLine($"{this.model} failed to resolve the problem"); return(null); }
public int?CanSolve(CPUProblem p) { if (DidThermalThrottle()) { SolvingInfo.NotSolved(this.model, p.Name); return(null); } SolvingInfo.Solved(this.model, p.Name); this.temperature += CPUProblemTemperatureMultiplier * p.RequiredThreads; return(p.Computation()); }
public int?Visit(CPUProblem cPUProblem) { if (!DidThermalThrottle()) { this.temperature += CPUProblemTemperatureMultiplier * cPUProblem.RequiredThreads; System.Console.WriteLine($"{this.model} resolved the problem"); return(cPUProblem.Computation()); } System.Console.WriteLine($"{this.model} failed to resolve the problem"); return(null); }
public virtual int?TrySolve(CPUProblem p) { if (temperature <= MaxTemperature) { temperature += p.RequiredThreads * CPUProblemTemperatureMultiplier; DidThermalThrottle(); Console.WriteLine("Problem {0} - solved with GPU {1}", p.Name, model); return(p.Computation()); } Console.WriteLine("Problem {0} - failed to solve with GPU {1}", p.Name, model); return(null); }