repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git]
/
src
/
performance
/
PerformanceStatistics.ts
diff --git
a/src/performance/PerformanceStatistics.ts
b/src/performance/PerformanceStatistics.ts
index b2333fded5f80ce1eba0c2638b08cb8ed8908ae2..ecd6b3ab72a8cbf5b2e31865d4e18fc5d91c5131 100644
(file)
--- a/
src/performance/PerformanceStatistics.ts
+++ b/
src/performance/PerformanceStatistics.ts
@@
-190,8
+190,8
@@
export class PerformanceStatistics {
}
const sortedDataSet = dataSet.slice().sort((a, b) => a - b);
const middleIndex = Math.floor(sortedDataSet.length / 2);
}
const sortedDataSet = dataSet.slice().sort((a, b) => a - b);
const middleIndex = Math.floor(sortedDataSet.length / 2);
- if (sortedDataSet.length % 2) {
- return sortedDataSet[middleIndex
/ 2
];
+ if (sortedDataSet.length % 2
=== 0
) {
+ return sortedDataSet[middleIndex];
}
return (sortedDataSet[middleIndex - 1] + sortedDataSet[middleIndex]) / 2;
}
}
return (sortedDataSet[middleIndex - 1] + sortedDataSet[middleIndex]) / 2;
}
@@
-215,7
+215,7
@@
export class PerformanceStatistics {
if (Number.isInteger(percentileIndex)) {
return (sortedDataSet[percentileIndex] + sortedDataSet[percentileIndex + 1]) / 2;
}
if (Number.isInteger(percentileIndex)) {
return (sortedDataSet[percentileIndex] + sortedDataSet[percentileIndex + 1]) / 2;
}
- return sortedDataSet[Math.
round
(percentileIndex)];
+ return sortedDataSet[Math.
floor
(percentileIndex)];
}
private stdDeviation(dataSet: number[]): number {
}
private stdDeviation(dataSet: number[]): number {