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:
parent
13f06d01e6
commit
ccb71fd0aa
@ -44,7 +44,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"processorConfig": {
|
"processorConfig": {
|
||||||
"spawnPointToleranceForForced": 99.5
|
"spawnPointToleranceForForced": 99.5,
|
||||||
|
"looseLootCountTolerancePercentage": 75
|
||||||
},
|
},
|
||||||
"writerConfig": {
|
"writerConfig": {
|
||||||
"outputLocation": "E:\\spt\\dumps\\output"
|
"outputLocation": "E:\\spt\\dumps\\output"
|
||||||
|
@ -8,4 +8,8 @@ public class ProcessorConfig
|
|||||||
[JsonProperty("spawnPointToleranceForForced")]
|
[JsonProperty("spawnPointToleranceForForced")]
|
||||||
[JsonPropertyName("spawnPointToleranceForForced")]
|
[JsonPropertyName("spawnPointToleranceForForced")]
|
||||||
public double SpawnPointToleranceForForced { get; set; } = 99D;
|
public double SpawnPointToleranceForForced { get; set; } = 99D;
|
||||||
|
|
||||||
|
[JsonProperty("looseLootCountTolerancePercentage")]
|
||||||
|
[JsonPropertyName("looseLootCountTolerancePercentage")]
|
||||||
|
public double LooseLootCountTolerancePercentage { get; set; } = 75D;
|
||||||
}
|
}
|
@ -81,6 +81,16 @@ public class LooseLootProcessor
|
|||||||
// No longer used, dispose
|
// No longer used, dispose
|
||||||
counts = null;
|
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
|
looseLootDistribution[mapName] = new LooseLootRoot
|
||||||
{
|
{
|
||||||
SpawnPointCount = new SpawnPointCount
|
SpawnPointCount = new SpawnPointCount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user