Apply density variation on the whole placement area, avoiding reduced free space under huge bloat

This commit is contained in:
Gabriel Gouvine 2023-06-29 15:11:00 +02:00
parent ffb5e38de2
commit fda7054840
1 changed files with 2 additions and 3 deletions

View File

@ -845,9 +845,8 @@ namespace Etesian {
}
// Compute the space margin from the row length computed earlier
double spaceMargin = (double) (totalLength - usedLength) / usedLength;
double densityVariation = getDensityVariation();
double bloatFactor = 1.0 + std::max(spaceMargin - densityVariation, 0.0);
double spaceFactor = (1.0 - getDensityVariation()) * totalLength / usedLength;
double bloatFactor = std::max(1.0, spaceFactor);
if (bloatFactor != 1.0) {
ostringstream bf;
bf << fixed << setprecision(2) << bloatFactor << "%";