public bool visit(CPUProblem problem) { //if(problem.RequiredThreads <= threads) //{ // Console.WriteLine(model + " with " + threads + " solved: " + problem.Name + " and Reuired threads: " + problem.RequiredThreads); // return true; //} //Console.WriteLine("*******************" + model + " with " + threads + " threads cant solve: " + problem.Name + " and Reuired threads: " + problem.RequiredThreads); return(problem.RequiredThreads <= threads); }
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?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 (p.RequiredThreads <= this.threads) { SolvingInfo.Solved(this.model, p.Name); return(p.Computation()); } SolvingInfo.NotSolved(this.model, p.Name); 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); }
public bool visit(CPUProblem problem) { //Console.WriteLine(model+ " with temperature: " + temperature + " and Maxtempeture: " + MaxTemperature); if (DidThermalThrottle()) { return(false); } temperature += problem.RequiredThreads * CPUProblemTemperatureMultiplier; // Console.WriteLine(model + " solved: "+nameof(CPUProblem)+" " +problem.Name +" RequiredThreads:"+ problem.RequiredThreads + " Current tempeture: " + temperature); return(true); }
public int?Solve(CPUProblem problem) { if (problem.RequiredThreads <= threads) { Console.WriteLine($"CPU {model} solve {problem.Name}"); return(problem.RequiredThreads); } else { Console.WriteLine($"CPU {model} is without enough threads to solve {problem.Name}"); return(null); } }
public int?Solve(CPUProblem problem) { if (temperature <= MaxTemperature) { temperature += problem.RequiredThreads * CPUProblemTemperatureMultiplier; Console.WriteLine($"GPU {model} solve {problem.Name}, temperature: {temperature}"); return(temperature); } else { DidThermalThrottle(); return(null); } }
public override int?Solve(CPUProblem problem) { Console.WriteLine($"Device {DeviceType} cannot solve {problem.Name}"); return(null); }
public int?CanSolve(CPUProblem p) { SolvingInfo.NotSolved(this.model, p.Name); return(null); }
abstract public int?Solve(CPUProblem problem);
public bool visit(CPUProblem problem) { return(false); }
public virtual int?TrySolve(CPUProblem p) { Console.WriteLine("Problem {0} - failed to solve with {1} {2}", p.Name, DeviceType, model); return(null); }
public int?Visit(CPUProblem cPUProblem) { System.Console.WriteLine($"{this.model} failed to resolve the problem"); return(null); }