Add evaluate() function that combines the eval fn's with weights
This commit is contained in:
parent
c2e91dc30a
commit
d52e4da215
|
@ -5,6 +5,31 @@ mod downstacking;
|
||||||
|
|
||||||
pub use downstacking::mystery_mdse;
|
pub use downstacking::mystery_mdse;
|
||||||
|
|
||||||
|
pub fn evaluate(mat: &Mat, pcnt: usize) -> i32 {
|
||||||
|
// TODO: public interface for weights etc.
|
||||||
|
|
||||||
|
struct Weights {
|
||||||
|
height: i32,
|
||||||
|
i_deps: i32,
|
||||||
|
mdse: i32,
|
||||||
|
pcnt: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
const W: Weights = Weights {
|
||||||
|
height: 5,
|
||||||
|
i_deps: 10,
|
||||||
|
mdse: 10,
|
||||||
|
pcnt: 10,
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut rating = 0;
|
||||||
|
rating += max_height(mat) * W.height;
|
||||||
|
rating += i_deps(mat) * W.i_deps;
|
||||||
|
rating += mystery_mdse(mat) * W.mdse;
|
||||||
|
rating += (pcnt as i32) * W.pcnt;
|
||||||
|
rating
|
||||||
|
}
|
||||||
|
|
||||||
pub fn max_height(matrix: &Mat) -> i32 {
|
pub fn max_height(matrix: &Mat) -> i32 {
|
||||||
matrix.rows() as i32
|
matrix.rows() as i32
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue