WIP Use random_hier_combinations

This commit is contained in:
Vitaliy Filippov
2023-05-18 17:44:00 +03:00
parent c1d470522c
commit 72f0cff79d
3 changed files with 76 additions and 23 deletions
+10
View File
@@ -19,6 +19,14 @@ const osd_tree2 = {
500: { 511: 1, 512: 1, 521: 1, 522: 1 },
};
const osd_tree3 = {
100: { 111: 1, 112: 1, 121: 1, 122: 1 },
200: { 211: 1, 212: 1, 221: 1, 222: 1 },
300: { 311: 1, 312: 1, 321: 1, 322: 1 },
400: { 411: 1, 412: 1, 421: 1, 422: 1 },
500: { 511: 1 },
};
async function run()
{
let r;
@@ -40,6 +48,8 @@ async function run()
));
if (JSON.stringify(r) != '{"rack1":{"OSD5":10},"rack2":{"OSD10":10}}')
throw new Error('extract_tree_levels failed');
// should not contain Z:
console.log(r = LPOptimizer.random_hier_combinations(osd_tree3, [ 3, 2 ], 0, false, true));
console.log('OK');
}