Try some logging to track down the AI issues, but it hasn't revealed anything.

This commit is contained in:
Starbeamrainbowlabs 2019-08-02 15:09:07 +01:00
parent 45541db0fa
commit bfc92e286e

View file

@ -61,6 +61,8 @@ class AIWrapper {
for(let lng = this.map_bounds.west; lng < this.map_bounds.east; lng += this.Config.step.lng) { for(let lng = this.map_bounds.west; lng < this.map_bounds.east; lng += this.Config.step.lng) {
let max_predicted_rssi = -Infinity; let max_predicted_rssi = -Infinity;
let chance = Math.random() < 0.01;
let log_line = "";
for(let [gateway_id, gateway] of this.gateways) { for(let [gateway_id, gateway] of this.gateways) {
let distance_from_gateway = haversine( let distance_from_gateway = haversine(
{ latitude: lat, longitude: lng }, { latitude: lat, longitude: lng },
@ -78,12 +80,17 @@ class AIWrapper {
throw new Error("Error: Neural Network returned NaN"); throw new Error("Error: Neural Network returned NaN");
} }
if(chance) {
log_line += `${gateway_id}: ${next_value[0]}\n`;
}
// console.log(next_value); // console.log(next_value);
max_predicted_rssi = Math.max( max_predicted_rssi = Math.max(
max_predicted_rssi, max_predicted_rssi,
next_value[0] next_value[0]
); );
} }
if(chance) console.log(`${log_line}----`);
// let chance = Math.random() < 0.01; // let chance = Math.random() < 0.01;
// if(chance) console.log(max_predicted_rssi); // if(chance) console.log(max_predicted_rssi);
max_predicted_rssi = unnormalise_rssi(max_predicted_rssi); max_predicted_rssi = unnormalise_rssi(max_predicted_rssi);