G7YVCY6HM6W46JYZWU6HY4VO4SQCHBP73LW2RTI2LPNRQD2TNKCAC 2WOLGB42T4EO7ZKLA5KFUYWVPTR6I3ET3FPJT4BSJFL43RRFRUBAC IVSW4A6P6V4K5ZCXMOB4ENW45U6LNKX7HD7AYTCHNRBGC64FK5IAC 2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC MKHG4OQBVXNOJFRUKKI2KN7VXJHXDWZUUYKGF22TKTBYEUEFCC5AC DJDWBCCQHQRKHGRKKQ32QY3WDEM7EKDDQ2YQLSSCS7HZTLHDRCFQC NQ22FUSWN6CBJKJ5H7UV5N2KEXBIXVNQDNL2EK6UJ3E7RFLWNVDQC const array_get_servers_trait = function (ns, array_servers, void_get_trait) {
// score correction methodsconst float_get_standard_score = function (float_original, array_numbers) {constfloat_get_variance = function (array_numbers) {const float_mean = float_get_mean(array_numbers);let float_sum_squared_differences = 0;for (let integer_indices_0 = 0;integer_indices_0 < array_numbers.length;++integer_indices_0)float_sum_squared_differences += Math.pow(array_numbers[integer_indices_0] - float_mean,2);return float_sum_squared_differences / array_numbers.length;},float_get_standard_deviation = function (array_numbers) {return Math.sqrt(float_get_variance(array_numbers));};return ((float_original - float_get_mean(array_numbers)) /float_get_standard_deviation(array_numbers));};const float_get_mean_normalised_score = function (float_original,array_numbers) {return ((float_original - float_get_mean(array_numbers)) /(Math.max(...array_numbers) - Math.min(...array_numbers)));};// returns a corrected score using a chosen correction methodconst float_get_corrected_score = function (float_original, array_numbers, float_method_score_correction) {return float_method_score_correction(float_original, array_numbers);};const array_get_servers_trait = function (ns, array_servers, float_get_trait_score) {
// gives a score for how well you will be able to hack a server (how much cash you can take per hack and how long it takes) given your current hacking level and its required hacking level. adapted from various functions in Hacking.js
// gives a score for how well you will be able to hack a server (how much cash you can take per hack, how long it takes and your chances of hacking it successfully) given your current hacking level and its required hacking level. adapted from various functions in Hacking.js
// returns the score of a server which is calculated by taking into account the deviation from mean of its max cash, its growth rate and your skill against it.
// returns the score of a server which is calculated by taking into account its max cash, its growth rate and your skill against it as factors which are corrected and summed.
float_mean_skill_against = float_get_servers_hackable_mean_trait(
// can change this to try different correction methodsfloat_method_score_correction = float_get_standard_score,float_get_score_factor = function (ns,string_server,float_method_score_correction,float_get_trait_score) {return float_get_corrected_score(float_get_trait_score(ns, string_server),array_get_servers_trait(ns,array_get_servers_hackable(ns),float_get_trait_score),float_method_score_correction);},float_factor_skill = float_get_score_factor(
),float_factor_skill =(float_get_skill_against(ns, string_server) - float_mean_skill_against) /float_mean_skill_against,float_factor_max_cash =(ns.getServerMaxMoney(string_server) - float_mean_server_cash_max) /float_mean_server_cash_max,float_factor_growth =(ns.getServerGrowth(string_server) - float_mean_server_growth) /float_mean_server_growth;
);
// Can adjust the weights of the variables. 1 = normal importance, > 1 = more importance, < 1 = less importance, 0 = not used, < 0 = negative effect.
// can adjust the weights of the factors. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect.
// duration between each joblet float_padding_seconds = 1;
// duration between each job used to prevent collisions between them to keep them in sequencelet float_padding_seconds = 0.5;