Skip to content

Commit 1f1de95

Browse files
committed
Merged branch develop into develop
2 parents b7258c3 + ae21384 commit 1f1de95

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

DaySim.Framework/Roster/ImpedanceRosterLoader.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,27 @@ public virtual void LoadSkimMatrices(IEnumerable<RosterEntry> entries, Dictionar
271271

272272
skimFileReader = creator.CreateReader(cache, _path, mapping);
273273

274-
var skimMatrix = skimFileReader.Read(entry.Name, entry.Field, (float)entry.Scaling);
274+
var scaleFactor = (float)entry.Scaling;
275+
var skimMatrix = skimFileReader.Read(entry.Name, entry.Field, scaleFactor);
275276

276277
SkimMatrices[entry.MatrixIndex] = skimMatrix;
278+
279+
//new code - report a summary of the skim matrix data
280+
var numZones = mapping.Count;
281+
var numPositive = 0;
282+
double avgPositive = 0;
283+
for (var row = 0; row < numZones; row++) {
284+
for (var col = 0; col < numZones; col++) {
285+
var value = skimMatrix.GetValue(row, col);
286+
if (value > Constants.EPSILON) {
287+
numPositive++;
288+
avgPositive += value / scaleFactor;
289+
}
290+
}
291+
}
292+
var pctPositive = Math.Round(numPositive * 100.0 / (numZones * numZones));
293+
var avgValue = avgPositive / Math.Max(numPositive, 1);
294+
Global.PrintFile.WriteLine("Skim File {0}, {1} percent of values are positive, with average value {2}.", entry.Name, pctPositive, avgValue);
277295
}
278296

279297
foreach (

0 commit comments

Comments
 (0)