Skip to content

Experimental/adding singlerun headless capabilty#179

Merged
justin-ven merged 9 commits intodevelopfrom
experimental/adding-singlerun-headless-capabilty
Jun 10, 2025
Merged

Experimental/adding singlerun headless capabilty#179
justin-ven merged 9 commits intodevelopfrom
experimental/adding-singlerun-headless-capabilty

Conversation

@andrewbaxter439
Copy link
Copy Markdown
Collaborator

What

Why

  • Not a fully necessary step for users if Make main entry points and jar files consistent for clearer model use #177 refactoring is useful: if we wanted to do all gui-less runs consistently via a single class/method then this would be redundant
  • However, it does allow for a potentially testable SimPathsStart full run, doing a headless replication of what the GUI does to make sure it works

Why it doesn't actually work

  • Ideally, this should test and close testing once done. But SimPathsStart.main() currently cannot exit.
  • So I've not yet aded the test
  • engine.startSimulation() and never returns? Where should a return statement be added to find 'the end', but allow GUI runs to keep programme running?

Questions

  • Worth having?
  • If we run a singlerun.jar -g false -Run test, is this best done as a maven integration test or a github actions test @igelstorm?

@andrewbaxter439
Copy link
Copy Markdown
Collaborator Author

Edit

It works now! will do a full single run headlessly using singlerun.jar, adds a test to see if it works. Should be a mostly sufficient test of whether the GUI-based runs work, without starting the GUI itself.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces headless single-run capability for singlerun.jar, allowing full simulation runs without the GUI and adds corresponding CLI flags and CI validation.

  • Adjust default population size for quicker test runs
  • Add doSetup/doRun flags with new Run CLI option and headless execution loop in SimPathsStart
  • Extend GitHub Actions workflow to invoke a full setup-and-run of the headless jar

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/main/java/simpaths/model/SimPathsModel.java Updated default popSize from 170000 to 50000
src/main/java/simpaths/experiment/SimPathsStart.java Introduced doSetup/doRun, new CLI options, headless loop, and conditional observer registration
.github/workflows/SimPathsBuild.yml Added run-simpaths-start job to validate headless setup & run
Comments suppressed due to low confidence (3)

src/main/java/simpaths/experiment/SimPathsStart.java:51

  • [nitpick] The flags doSetup and doRun are somewhat ambiguous; consider renaming to setupOnly/runOnly or similar to clearly express their intent.
private static boolean doSetup = true;

.github/workflows/SimPathsBuild.yml:61

  • The workflow currently only verifies input files; consider adding checks for expected output artifacts (e.g., simulation results) to ensure the headless run completes successfully.
run: java -jar singlerun.jar -c UK -s 2019 -g false --rewrite-policy-schedule

src/main/java/simpaths/experiment/SimPathsStart.java:229

  • Omitting the observer in headless mode may disable critical observation logic. Verify that removing the observer for non-GUI runs does not impact required data collection or reporting.
if (showGui) engine.addSimulationManager(observer);

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrewbaxter439 andrewbaxter439 added the enhancement New feature or request label May 30, 2025
@justin-ven
Copy link
Copy Markdown
Contributor

Good to hear that you found a work-around

@justin-ven justin-ven merged commit f841dfa into develop Jun 10, 2025
5 checks passed
@andrewbaxter439 andrewbaxter439 deleted the experimental/adding-singlerun-headless-capabilty branch January 21, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants