Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Merge requests
!210
Add "Initial Guess" Search Strategy
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add "Initial Guess" Search Strategy
stu222169/theodolite-extensions:issue-258
into
master
Overview
0
Commits
6
Pipelines
1
Changes
7
Merged
Julia Rossow
requested to merge
stu222169/theodolite-extensions:issue-258
into
master
3 years ago
Overview
0
Commits
6
Pipelines
1
Changes
7
Expand
Fix
#258 (closed)
Edited
3 years ago
by
Sören Henning
0
0
Merge request reports
Viewing commit
cb037267
Show latest version
7 files
+
180
−
5
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
cb037267
New strategy InitialGuessSearchStrategy
· cb037267
Julia Rossow
authored
3 years ago
theodolite/src/main/kotlin/theodolite/strategies/searchstrategy/BinarySearch.kt
+
7
−
1
Options
@@ -13,7 +13,13 @@ private val logger = KotlinLogging.logger {}
@@ -13,7 +13,13 @@ private val logger = KotlinLogging.logger {}
* @param benchmarkExecutor Benchmark executor which runs the individual benchmarks.
* @param benchmarkExecutor Benchmark executor which runs the individual benchmarks.
*/
*/
class
BinarySearch
(
benchmarkExecutor
:
BenchmarkExecutor
)
:
SearchStrategy
(
benchmarkExecutor
)
{
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
)
val
result
=
binarySearch
(
load
,
resources
,
0
,
resources
.
size
-
1
)
if
(
result
==
-
1
)
{
if
(
result
==
-
1
)
{
return
null
return
null
Loading