Skip to content
Snippets Groups Projects

Add "Initial Guess" Search Strategy

Files

@@ -13,7 +13,13 @@ private val logger = KotlinLogging.logger {}
* @param benchmarkExecutor Benchmark executor which runs the individual benchmarks.
*/
class BinarySearch(benchmarkExecutor: BenchmarkExecutor) : SearchStrategy(benchmarkExecutor) {
override fun findSuitableResource(load: LoadDimension, resources: List<Resource>): Resource? {
override fun findSuitableResource(load: LoadDimension, resources: List<Resource>,
lastLowestResource: Resource?): Resource? {
if (lastLowestResource != null) {
logger.info { "Running LinearSearch with a set lastLowestResource value doesn't make sense." }
}
val result = binarySearch(load, resources, 0, resources.size - 1)
if (result == -1) {
return null
Loading