fitness calculators | oring properties
hi @spodila just testing out fenzo
Seeing the binpackingfitnescalculators.* it's effectively
sum ( fitness_i( request ).... + fitness_n( request) ) / total_fitness_fns
# or | fitness |
Wondering if it'd be worth it to make it OR objects... so that one can do
builder.
.....
.withFitnessCalculator ( Fitness1 | Fitness2 | Fitness3 )
.build()
Interested in a patch?
I guess two things:
- You can use constraints to do what I want - effectively further filtering of machines to offers
- Since there are fairly small set of resources on mesos (cpu, mem, gpu, bandwidth)... it's not really too bad to have 4 or even 10 (in the future) that are hard coded since for most workloads you'll need CPU + mem so the permutations are not that many ... w/ or w/out network, w/ or w/out gpu.. etc.
Hello @senior7515 thank you, hope you find it useful.
Could you elaborate on what you mean by the OR operation here? Fitness functions are expected to return a double value between 0.0 to 1.0. So, does your expression translate to, for example,
.withFitnessCalculator ( 0.1 | 0.4 | 0.67 )
Sounds like I may have misinterpreted your suggestion?
ah sorry, I mean to say combiner operation.
Say you have binpacking.cpu as well as binpacking.mem
you would then be able to say:
.withFitnessCalculator (binpacking.cpu | binpacking.mem)
The result, internally would be: ;
double result = (binpacking.cpu ( request ) + binpacking.mem( request ) )/ 2.0
which is exactly what happens right now internally.
OK, this sounds good. Looking forward to your PR.