Added code to check for odd cases in dumps where way more than average would be included for mean and std calculation

This commit is contained in:
clodan 2024-01-17 00:45:38 +00:00
parent 13f06d01e6
commit ccb71fd0aa
3 changed files with 16 additions and 1 deletions

View File

@ -44,7 +44,8 @@
]
},
"processorConfig": {
"spawnPointToleranceForForced": 99.5
"spawnPointToleranceForForced": 99.5,
"looseLootCountTolerancePercentage": 75
},
"writerConfig": {
"outputLocation": "E:\\spt\\dumps\\output"

View File

@ -8,4 +8,8 @@ public class ProcessorConfig
[JsonProperty("spawnPointToleranceForForced")]
[JsonPropertyName("spawnPointToleranceForForced")]
public double SpawnPointToleranceForForced { get; set; } = 99D;
[JsonProperty("looseLootCountTolerancePercentage")]
[JsonPropertyName("looseLootCountTolerancePercentage")]
public double LooseLootCountTolerancePercentage { get; set; } = 75D;
}

View File

@ -81,6 +81,16 @@ public class LooseLootProcessor
// No longer used, dispose
counts = null;
// we want to cleanup the data, so we calculate the mean for the values we get raw
// For whatever reason, we sometimes get dumps that have A LOT more loose loot point than
// the average
var initialMean = np.mean(np.array(looseLootCounts.MapSpawnpointCount)).ToArray<double>().First();
var looseLootCountTolerancePercentage = LootDumpProcessorContext.GetConfig().ProcessorConfig.LooseLootCountTolerancePercentage / 100;
// We calculate here a high point to check, anything above this value will be ignored
// The data that was inside those loose loot points still counts for them though!
var high = initialMean * (1 + looseLootCountTolerancePercentage);
looseLootCounts.MapSpawnpointCount = looseLootCounts.MapSpawnpointCount.Where(v => v <= high).ToList();
looseLootDistribution[mapName] = new LooseLootRoot
{
SpawnPointCount = new SpawnPointCount