From 64e7020e1665fc11e2a6392a107d1f259194adb5 Mon Sep 17 00:00:00 2001 From: Romuald Rousseau Date: Wed, 13 Nov 2024 19:52:17 +0800 Subject: [PATCH] fix: Take into account only non empty cell --- .../romualdrousseau/archery/header/DataTableHeader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java b/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java index 107024f..7a6876f 100644 --- a/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java +++ b/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java @@ -98,9 +98,12 @@ private List sampleEntities() { if (cell.getSymbol().equals("e")) { entityVector.iadd(cell.getEntityVector()); } - + n += Settings.DEFAULT_ENTITY_PROBABILITY; } + if (n == 0.0f) { + n = N + 1; + } entityVector.if_lt_then(n, 0.0f, 1.0f); final var entityList = this.getTable().getSheet().getDocument().getModel().getEntityList(); return IntStream.range(0, entityVector.size).boxed()