Skip to content
Snippets Groups Projects
Commit 4ea2b034 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

apply review (clean up)

parent 4d3587f5
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!78Resolve "Implement Quarkus/Kotlin protype"
......@@ -5,5 +5,5 @@ import theodolite.util.LoadDimension
import theodolite.util.Resource
abstract class RestrictionStrategy(val results: Results) {
public abstract fun next(load: LoadDimension, resources: List<Resource>): List<Resource>;
public abstract fun next(load: LoadDimension, resources: List<Resource>): List<Resource>
}
\ No newline at end of file
......@@ -20,21 +20,20 @@ class BinarySearch(benchmarkExecutor: BenchmarkExecutor, results: Results) : Sea
throw IllegalArgumentException()
}
if (lower == upper ) {
if (this.benchmarkExecutor.runExperiment(load, resources[lower])) return lower;
if (this.benchmarkExecutor.runExperiment(load, resources[lower])) return lower
else {
if (lower + 1 == resources.size) return - 1
return lower + 1;
return lower + 1
}
} else {
// (true, true), (false, true), (false, false) // (false, false, false, true, false, true, false, true)
val mid = (upper + lower) / 2
if (this.benchmarkExecutor.runExperiment(load, resources[mid])) {
if (mid == lower) {
return lower
}
return search(load, resources, lower, mid - 1 );
return search(load, resources, lower, mid - 1 )
} else {
return search(load, resources, mid + 1 , upper);
return search(load, resources, mid + 1 , upper)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment