Remove debugging print (2)

This commit is contained in:
hppeng 2022-07-17 23:33:39 -07:00
parent 2d9a6bb5a1
commit 6e590dde01

View file

@ -78,7 +78,7 @@ function apply_to_fit(skillpoints, item, skillpoint_min, activeSetCounts) {
} }
function calculate_skillpoints(equipment, weapon) { function calculate_skillpoints(equipment, weapon) {
const start = performance.now(); // const start = performance.now();
// Calculate equipment equipping order and required skillpoints. // Calculate equipment equipping order and required skillpoints.
// Return value: [equip_order, best_skillpoints, final_skillpoints, best_total]; // Return value: [equip_order, best_skillpoints, final_skillpoints, best_total];
let fixed = []; let fixed = [];
@ -131,7 +131,6 @@ function calculate_skillpoints(equipment, weapon) {
const [root, terminal, sccs] = construct_scc_graph(consider); const [root, terminal, sccs] = construct_scc_graph(consider);
const end_checks = crafted.concat(noboost); const end_checks = crafted.concat(noboost);
end_checks.push(weapon); end_checks.push(weapon);
console.log(sccs);
function check_end(skillpoints_applied, skillpoints, activeSetCounts, total_applied) { function check_end(skillpoints_applied, skillpoints, activeSetCounts, total_applied) {
// Crafted skillpoint does not count initially. // Crafted skillpoint does not count initially.
@ -153,7 +152,6 @@ function calculate_skillpoints(equipment, weapon) {
function permute_check(idx, _applied, _skillpoints, _sets, _has, _total_applied, order) { function permute_check(idx, _applied, _skillpoints, _sets, _has, _total_applied, order) {
const {nodes, children} = sccs[idx]; const {nodes, children} = sccs[idx];
if (nodes[0] === terminal) { if (nodes[0] === terminal) {
console.log(order);
const total = check_end(_applied, _skillpoints, _sets, _total_applied); const total = check_end(_applied, _skillpoints, _sets, _total_applied);
if (total !== -1 && total < best_total) { if (total !== -1 && total < best_total) {
final_skillpoints = _skillpoints; final_skillpoints = _skillpoints;
@ -161,8 +159,6 @@ function calculate_skillpoints(equipment, weapon) {
best_total = total; best_total = total;
best_activeSetCounts = _sets; best_activeSetCounts = _sets;
best = order; best = order;
console.log('new best');
console.log(total);
} }
return; return;
} }
@ -216,9 +212,9 @@ function calculate_skillpoints(equipment, weapon) {
// best_skillpoints: manually assigned (before any gear) // best_skillpoints: manually assigned (before any gear)
// final_skillpoints: final totals (5 individ) // final_skillpoints: final totals (5 individ)
// best_total: total skillpoints assigned (number) // best_total: total skillpoints assigned (number)
const end = performance.now(); // const end = performance.now();
const output_msg = `skillpoint calculation took ${(end-start)/ 1000} seconds.`; // const output_msg = `skillpoint calculation took ${(end-start)/ 1000} seconds.`;
console.log(output_msg); // console.log(output_msg);
return [equip_order, best_skillpoints, final_skillpoints, best_total, best_activeSetCounts]; return [equip_order, best_skillpoints, final_skillpoints, best_total, best_activeSetCounts];
} }