From bb0db69b3a609d1f6297eaaf29efbfcef91f896c Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:24:17 -0800 Subject: [PATCH 01/11] updating version of action-checkstyle --- .github/config/checks.xml | 5 ----- .github/workflows/lint.yml | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/config/checks.xml b/.github/config/checks.xml index ec6a8f485..8f1ea6cea 100644 --- a/.github/config/checks.xml +++ b/.github/config/checks.xml @@ -29,11 +29,6 @@ - - - - - diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9bec19056..929733889 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,12 +15,12 @@ jobs: fetch-depth: 0 - name: Lint code base - uses: dbelyaev/action-checkstyle@v0.9.5 + uses: dbelyaev/action-checkstyle@v3.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check checkstyle_config: .github/config/checks.xml - fail_on_error: true + fail_level: error update-lint-badges: if: ${{ always() && github.ref == 'refs/heads/main' }} From 7f0b1836fa444b7ff12c8e56f29b2b90a160369b Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:34:36 -0800 Subject: [PATCH 02/11] make XMLFileEditor final --- src/arcade/core/gui/GUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arcade/core/gui/GUI.java b/src/arcade/core/gui/GUI.java index 4e1d6d76f..d62ab204c 100644 --- a/src/arcade/core/gui/GUI.java +++ b/src/arcade/core/gui/GUI.java @@ -37,7 +37,7 @@ *

When the model is called with arguments, then the {@code main} method in {@link * arcade.core.ARCADE} is called directly and {@code GUI} is not shown. */ -public class GUI implements ActionListener { +public final class GUI implements ActionListener { /** GUI frame. */ private static JFrame frame; From 1563aed058951657581d8a293c5b676b6a2d4e01 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:37:26 -0800 Subject: [PATCH 03/11] actually making XMLFileFilter final --- src/arcade/core/gui/GUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arcade/core/gui/GUI.java b/src/arcade/core/gui/GUI.java index d62ab204c..2eb7941ad 100644 --- a/src/arcade/core/gui/GUI.java +++ b/src/arcade/core/gui/GUI.java @@ -37,7 +37,7 @@ *

When the model is called with arguments, then the {@code main} method in {@link * arcade.core.ARCADE} is called directly and {@code GUI} is not shown. */ -public final class GUI implements ActionListener { +public class GUI implements ActionListener { /** GUI frame. */ private static JFrame frame; @@ -371,7 +371,7 @@ public File getPath() { } /** Custom file filter for XML files. */ - private static class XMLFileFilter extends FileFilter { + private static final class XMLFileFilter extends FileFilter { /** * Determines if the file is an XML file. * From 97406a70582a40c13a08cb695cd378101992833a Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:44:00 -0800 Subject: [PATCH 04/11] adding back in linelength check --- .github/config/checks.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/config/checks.xml b/.github/config/checks.xml index 8f1ea6cea..28ea9298d 100644 --- a/.github/config/checks.xml +++ b/.github/config/checks.xml @@ -29,6 +29,11 @@ + + + + + @@ -178,7 +183,11 @@ - + + + + + From 89c87b017160ff1e83a7743490063475ca764d81 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:53:51 -0800 Subject: [PATCH 05/11] changing file length error to warning for test files --- .github/config/checks.xml | 14 +++++++++++++- .github/config/suppressions.xml | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/config/checks.xml b/.github/config/checks.xml index 28ea9298d..978432c2a 100644 --- a/.github/config/checks.xml +++ b/.github/config/checks.xml @@ -28,7 +28,19 @@ - + + + + + + + + + + + + + diff --git a/.github/config/suppressions.xml b/.github/config/suppressions.xml index b8543db99..76fe9fa8f 100644 --- a/.github/config/suppressions.xml +++ b/.github/config/suppressions.xml @@ -10,6 +10,7 @@ + @@ -21,4 +22,14 @@ + + + + + + From 271ec067d267d50dec373ffbdc134aaa6ee1aa89 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 10:56:32 -0800 Subject: [PATCH 06/11] remove whitespace --- test/arcade/potts/sim/Potts3DTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/arcade/potts/sim/Potts3DTest.java b/test/arcade/potts/sim/Potts3DTest.java index 1cda3803e..539977996 100644 --- a/test/arcade/potts/sim/Potts3DTest.java +++ b/test/arcade/potts/sim/Potts3DTest.java @@ -208,7 +208,7 @@ private static void populate(int[][] array, int n, int k) { array[index++] = s.clone(); - for (; ; ) { + for (; ;) { int ii = k - 1; for (int i = k - 1; i >= 0 && s[i] == n - k + i; i--) { ii--; From 3967fbab00cf852582de86c86c809296aea49eee Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 11:02:01 -0800 Subject: [PATCH 07/11] refactoring --- src/arcade/potts/vis/PottsVisualization.java | 635 +++++++++++-------- test/arcade/potts/sim/Potts3DTest.java | 2 +- 2 files changed, 370 insertions(+), 267 deletions(-) diff --git a/src/arcade/potts/vis/PottsVisualization.java b/src/arcade/potts/vis/PottsVisualization.java index 9b524964a..68ca08c3b 100644 --- a/src/arcade/potts/vis/PottsVisualization.java +++ b/src/arcade/potts/vis/PottsVisualization.java @@ -1,5 +1,6 @@ package arcade.potts.vis; +import java.util.ArrayList; import sim.engine.SimState; import arcade.core.sim.Series; import arcade.core.sim.Simulation; @@ -181,272 +182,374 @@ Drawer[] create3DDrawers() { int hx = (int) Math.round((height + .0) / (length + height) * h); int vx = (int) Math.round((height + .0) / (width + height) * v); - return new Drawer[] { - new PottsDrawer.PottsCells( - panels[0], - "agents:CYTOPLASM:Z", - length, - width, - height, - MAP_CYTOPLASM, - getBox(0, 0, hh * 2, vv * 2)), - new PottsDrawer.PottsCells( - panels[0], - "agents:CYTOPLASM:X", - length, - width, - height, - MAP_CYTOPLASM, - getBox(hh * 2, 0, hx * 2, vv * 2)), - new PottsDrawer.PottsCells( - panels[0], - "agents:CYTOPLASM:Y", - length, - width, - height, - MAP_CYTOPLASM, - getBox(0, vv * 2, hh * 2, vx * 2)), - new PottsDrawer.PottsCells( - panels[0], - "agents:NUCLEUS:Z", - length, - width, - height, - MAP_NUCLEUS, - getBox(0, 0, hh * 2, vv * 2)), - new PottsDrawer.PottsCells( - panels[0], - "agents:NUCLEUS:X", - length, - width, - height, - MAP_NUCLEUS, - getBox(hh * 2, 0, hx * 2, vv * 2)), - new PottsDrawer.PottsCells( - panels[0], - "agents:NUCLEUS:Y", - length, - width, - height, - MAP_NUCLEUS, - getBox(0, vv * 2, hh * 2, vx * 2)), - new PottsDrawer.PottsCells( - panels[1], - "agents:STATE:Z", - length, - width, - height, - MAP_STATE, - getBox(0, 0, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:POPULATION:Z", - length, - width, - height, - MAP_POPULATION, - getBox(h, 0, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:VOLUME:Z", - length, - width, - height, - maps.mapVolume, - getBox(0, v, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:HEIGHT:Z", - length, - width, - height, - maps.mapHeight, - getBox(h, v, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Z", - length, - width, - height, - MAP_OVERLAY, - getBox(0, 0, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Z", - length, - width, - height, - MAP_OVERLAY, - getBox(h, 0, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Z", - length, - width, - height, - MAP_OVERLAY, - getBox(0, v, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Z", - length, - width, - height, - MAP_OVERLAY, - getBox(h, v, hh, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Z", length, width, height, getBox(0, 0, hh, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Z", length, width, height, getBox(h, 0, hh, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Z", length, width, height, getBox(0, v, hh, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Z", length, width, height, getBox(h, v, hh, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:STATE:X", - length, - width, - height, - MAP_STATE, - getBox(hh, 0, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:POPULATION:X", - length, - width, - height, - MAP_POPULATION, - getBox(h + hh, 0, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:VOLUME:X", - length, - width, - height, - maps.mapVolume, - getBox(hh, v, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:HEIGHT:X", - length, - width, - height, - maps.mapHeight, - getBox(h + hh, v, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:X", - length, - width, - height, - MAP_OVERLAY, - getBox(hh, 0, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:X", - length, - width, - height, - MAP_OVERLAY, - getBox(h + hh, 0, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:X", - length, - width, - height, - MAP_OVERLAY, - getBox(hh, v, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:X", - length, - width, - height, - MAP_OVERLAY, - getBox(h + hh, v, hx, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:X", length, width, height, getBox(hh, 0, hx, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:X", length, width, height, getBox(h + hh, 0, hx, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:X", length, width, height, getBox(hh, v, hx, vv)), - new PottsDrawer.PottsGrid( - panels[1], "grid:X", length, width, height, getBox(h + hh, v, hx, vv)), - new PottsDrawer.PottsCells( - panels[1], - "agents:STATE:Y", - length, - width, - height, - MAP_STATE, - getBox(0, vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:POPULATION:Y", - length, - width, - height, - MAP_POPULATION, - getBox(h, vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:VOLUME:Y", - length, - width, - height, - maps.mapVolume, - getBox(0, v + vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:HEIGHT:Y", - length, - width, - height, - maps.mapHeight, - getBox(h, v + vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Y", - length, - width, - height, - MAP_OVERLAY, - getBox(0, vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Y", - length, - width, - height, - MAP_OVERLAY, - getBox(h, vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Y", - length, - width, - height, - MAP_OVERLAY, - getBox(0, v + vv, hh, vx)), - new PottsDrawer.PottsCells( - panels[1], - "agents:OVERLAY:Y", - length, - width, - height, - MAP_OVERLAY, - getBox(h, v + vv, hh, vx)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Y", length, width, height, getBox(0, vv, hh, vx)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Y", length, width, height, getBox(h, vv, hh, vx)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Y", length, width, height, getBox(0, v + vv, hh, vx)), - new PottsDrawer.PottsGrid( - panels[1], "grid:Y", length, width, height, getBox(h, v + vv, hh, vx)), - }; + ArrayList drawers = new ArrayList(); + + add3DPanel0Drawers(drawers, hh, vv, hx, vx); + add3DZDrawers(drawers, h, v, hh, vv); + add3DXDrawers(drawers, h, v, hh, vv, hx); + add3DYDrawers(drawers, h, v, hh, vv, vx); + + return drawers.toArray(new Drawer[0]); + } + + private void add3DPanel0Drawers(ArrayList drawers, int hh, int vv, int hx, int vx) { + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:CYTOPLASM:Z", + length, + width, + height, + MAP_CYTOPLASM, + getBox(0, 0, hh * 2, vv * 2))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:CYTOPLASM:X", + length, + width, + height, + MAP_CYTOPLASM, + getBox(hh * 2, 0, hx * 2, vv * 2))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:CYTOPLASM:Y", + length, + width, + height, + MAP_CYTOPLASM, + getBox(0, vv * 2, hh * 2, vx * 2))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:NUCLEUS:Z", + length, + width, + height, + MAP_NUCLEUS, + getBox(0, 0, hh * 2, vv * 2))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:NUCLEUS:X", + length, + width, + height, + MAP_NUCLEUS, + getBox(hh * 2, 0, hx * 2, vv * 2))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[0], + "agents:NUCLEUS:Y", + length, + width, + height, + MAP_NUCLEUS, + getBox(0, vv * 2, hh * 2, vx * 2))); + } + + private void add3DZDrawers(ArrayList drawers, int h, int v, int hh, int vv) { + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:STATE:Z", + length, + width, + height, + MAP_STATE, + getBox(0, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:POPULATION:Z", + length, + width, + height, + MAP_POPULATION, + getBox(h, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:VOLUME:Z", + length, + width, + height, + maps.mapVolume, + getBox(0, v, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:HEIGHT:Z", + length, + width, + height, + maps.mapHeight, + getBox(h, v, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Z", + length, + width, + height, + MAP_OVERLAY, + getBox(0, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Z", + length, + width, + height, + MAP_OVERLAY, + getBox(h, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Z", + length, + width, + height, + MAP_OVERLAY, + getBox(0, v, hh, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Z", + length, + width, + height, + MAP_OVERLAY, + getBox(h, v, hh, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Z", length, width, height, getBox(0, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Z", length, width, height, getBox(h, 0, hh, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Z", length, width, height, getBox(0, v, hh, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Z", length, width, height, getBox(h, v, hh, vv))); + } + + private void add3DXDrawers(ArrayList drawers, int h, int v, int hh, int vv, int hx) { + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:STATE:X", + length, + width, + height, + MAP_STATE, + getBox(hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:POPULATION:X", + length, + width, + height, + MAP_POPULATION, + getBox(h + hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:VOLUME:X", + length, + width, + height, + maps.mapVolume, + getBox(hh, v, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:HEIGHT:X", + length, + width, + height, + maps.mapHeight, + getBox(h + hh, v, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:X", + length, + width, + height, + MAP_OVERLAY, + getBox(hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:X", + length, + width, + height, + MAP_OVERLAY, + getBox(h + hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:X", + length, + width, + height, + MAP_OVERLAY, + getBox(hh, v, hx, vv))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:X", + length, + width, + height, + MAP_OVERLAY, + getBox(h + hh, v, hx, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:X", length, width, height, getBox(hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:X", length, width, height, getBox(h + hh, 0, hx, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:X", length, width, height, getBox(hh, v, hx, vv))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:X", length, width, height, getBox(h + hh, v, hx, vv))); + } + + private void add3DYDrawers(ArrayList drawers, int h, int v, int hh, int vv, int vx) { + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:STATE:Y", + length, + width, + height, + MAP_STATE, + getBox(0, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:POPULATION:Y", + length, + width, + height, + MAP_POPULATION, + getBox(h, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:VOLUME:Y", + length, + width, + height, + maps.mapVolume, + getBox(0, v + vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:HEIGHT:Y", + length, + width, + height, + maps.mapHeight, + getBox(h, v + vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Y", + length, + width, + height, + MAP_OVERLAY, + getBox(0, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Y", + length, + width, + height, + MAP_OVERLAY, + getBox(h, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Y", + length, + width, + height, + MAP_OVERLAY, + getBox(0, v + vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsCells( + panels[1], + "agents:OVERLAY:Y", + length, + width, + height, + MAP_OVERLAY, + getBox(h, v + vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Y", length, width, height, getBox(0, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Y", length, width, height, getBox(h, vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Y", length, width, height, getBox(0, v + vv, hh, vx))); + + drawers.add( + new PottsDrawer.PottsGrid( + panels[1], "grid:Y", length, width, height, getBox(h, v + vv, hh, vx))); } @Override diff --git a/test/arcade/potts/sim/Potts3DTest.java b/test/arcade/potts/sim/Potts3DTest.java index 539977996..1cda3803e 100644 --- a/test/arcade/potts/sim/Potts3DTest.java +++ b/test/arcade/potts/sim/Potts3DTest.java @@ -208,7 +208,7 @@ private static void populate(int[][] array, int n, int k) { array[index++] = s.clone(); - for (; ;) { + for (; ; ) { int ii = k - 1; for (int i = k - 1; i >= 0 && s[i] == n - k + i; i--) { ii--; From 95eaf5815a84af79a1e4e9f8711a1f4786a500e3 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 11:04:04 -0800 Subject: [PATCH 08/11] remove whitespace --- test/arcade/potts/sim/Potts3DTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/arcade/potts/sim/Potts3DTest.java b/test/arcade/potts/sim/Potts3DTest.java index 1cda3803e..539977996 100644 --- a/test/arcade/potts/sim/Potts3DTest.java +++ b/test/arcade/potts/sim/Potts3DTest.java @@ -208,7 +208,7 @@ private static void populate(int[][] array, int n, int k) { array[index++] = s.clone(); - for (; ; ) { + for (; ;) { int ii = k - 1; for (int i = k - 1; i >= 0 && s[i] == n - k + i; i--) { ii--; From 64baa40f28a7edc4273c496b82c1124e0269fbbb Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 11:19:05 -0800 Subject: [PATCH 09/11] changed for(; ;) to while(true) for formatting --- .github/config/checks.xml | 1 - test/arcade/potts/sim/Potts3DTest.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/config/checks.xml b/.github/config/checks.xml index 978432c2a..bf65fcacf 100644 --- a/.github/config/checks.xml +++ b/.github/config/checks.xml @@ -34,7 +34,6 @@ - diff --git a/test/arcade/potts/sim/Potts3DTest.java b/test/arcade/potts/sim/Potts3DTest.java index 539977996..66b172123 100644 --- a/test/arcade/potts/sim/Potts3DTest.java +++ b/test/arcade/potts/sim/Potts3DTest.java @@ -208,7 +208,7 @@ private static void populate(int[][] array, int n, int k) { array[index++] = s.clone(); - for (; ;) { + while (true) { int ii = k - 1; for (int i = k - 1; i >= 0 && s[i] == n - k + i; i--) { ii--; From 2b5fb8b03d03f68b6f9653d8704f9e8c448224f6 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 12:22:26 -0800 Subject: [PATCH 10/11] adding docstrings I hope are correct --- src/arcade/potts/vis/PottsVisualization.java | 58 ++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/src/arcade/potts/vis/PottsVisualization.java b/src/arcade/potts/vis/PottsVisualization.java index 68ca08c3b..bfa672a13 100644 --- a/src/arcade/potts/vis/PottsVisualization.java +++ b/src/arcade/potts/vis/PottsVisualization.java @@ -176,11 +176,11 @@ Drawer[] create3DDrawers() { int h = horizontal / 2; int v = vertical / 2; - int hh = (int) Math.round((length + .0) / (length + height) * h); - int vv = (int) Math.round((width + .0) / (width + height) * v); + int hh = (int) Math.round((length + .0) / (length + height) * h); // no x + int vv = (int) Math.round((width + .0) / (width + height) * v); // no y - int hx = (int) Math.round((height + .0) / (length + height) * h); - int vx = (int) Math.round((height + .0) / (width + height) * v); + int hx = (int) Math.round((height + .0) / (length + height) * h); // no x + int vx = (int) Math.round((height + .0) / (width + height) * v); // no y ArrayList drawers = new ArrayList(); @@ -192,6 +192,18 @@ Drawer[] create3DDrawers() { return drawers.toArray(new Drawer[0]); } + /** + * Creates drawers for panel 0 + * + *

These drawers display cytoplasm and nucleus components for each of the three main + * projection planes (X, Y, and Z). + * + * @param drawers the list to which drawers are added + * @param hh horizontal subdivision factor for the Z projection + * @param vv vertical subdivision factor for the Z projection + * @param hx horizontal subdivision factor for the X projection + * @param vx vertical subdivision factor for the Y projection + */ private void add3DPanel0Drawers(ArrayList drawers, int hh, int vv, int hx, int vx) { drawers.add( @@ -255,6 +267,18 @@ private void add3DPanel0Drawers(ArrayList drawers, int hh, int vv, int h getBox(0, vv * 2, hh * 2, vx * 2))); } + /** + * Adds drawers for the Z-axis projections on panel 1. + * + *

These drawers render STATE, POPULATION, VOLUME, HEIGHT, and OVERLAY views along the Z + * axis, plus grid overlays for each region. + * + * @param drawers the list to which drawers are added + * @param h half the total horizontal panel width + * @param v half the total vertical panel height + * @param hh scaled horizontal subdivision for Z projections + * @param vv scaled vertical subdivision for Z projections + */ private void add3DZDrawers(ArrayList drawers, int h, int v, int hh, int vv) { drawers.add( @@ -354,6 +378,19 @@ private void add3DZDrawers(ArrayList drawers, int h, int v, int hh, int panels[1], "grid:Z", length, width, height, getBox(h, v, hh, vv))); } + /** + * Adds drawers for the X-axis projections on panel 1. + * + *

These drawers render STATE, POPULATION, VOLUME, HEIGHT, and OVERLAY views along the X + * axis, plus grid overlays for each region. + * + * @param drawers the list to which drawers are added + * @param h half the total horizontal panel width + * @param v half the total vertical panel height + * @param hh scaled horizontal subdivision for Z projections + * @param vv scaled vertical subdivision for Z projections + * @param hx scaled horizontal subdivision for X projections + */ private void add3DXDrawers(ArrayList drawers, int h, int v, int hh, int vv, int hx) { drawers.add( @@ -453,6 +490,19 @@ private void add3DXDrawers(ArrayList drawers, int h, int v, int hh, int panels[1], "grid:X", length, width, height, getBox(h + hh, v, hx, vv))); } + /** + * Adds drawers for the Y-axis projections on panel 1. + * + *

These drawers render STATE, POPULATION, VOLUME, HEIGHT, and OVERLAY views along the Y + * axis, plus grid overlays for each region. + * + * @param drawers the list to which drawers are added + * @param h half the total horizontal panel width + * @param v half the total vertical panel height + * @param hh scaled horizontal subdivision for Z projections + * @param vv scaled vertical subdivision for Z projections + * @param vx scaled vertical subdivision for Y projections + */ private void add3DYDrawers(ArrayList drawers, int h, int v, int hh, int vv, int vx) { drawers.add( From 0a05c8c5ff88971b50bf43105773d07bfba1abd6 Mon Sep 17 00:00:00 2001 From: jannetty Date: Mon, 10 Nov 2025 12:23:56 -0800 Subject: [PATCH 11/11] remove comments --- src/arcade/potts/vis/PottsVisualization.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arcade/potts/vis/PottsVisualization.java b/src/arcade/potts/vis/PottsVisualization.java index bfa672a13..d346d80c1 100644 --- a/src/arcade/potts/vis/PottsVisualization.java +++ b/src/arcade/potts/vis/PottsVisualization.java @@ -176,11 +176,11 @@ Drawer[] create3DDrawers() { int h = horizontal / 2; int v = vertical / 2; - int hh = (int) Math.round((length + .0) / (length + height) * h); // no x - int vv = (int) Math.round((width + .0) / (width + height) * v); // no y + int hh = (int) Math.round((length + .0) / (length + height) * h); + int vv = (int) Math.round((width + .0) / (width + height) * v); - int hx = (int) Math.round((height + .0) / (length + height) * h); // no x - int vx = (int) Math.round((height + .0) / (width + height) * v); // no y + int hx = (int) Math.round((height + .0) / (length + height) * h); + int vx = (int) Math.round((height + .0) / (width + height) * v); ArrayList drawers = new ArrayList();