Skip to content

Use new Supplier-based jasmine API - #503

Merged
amorison merged 46 commits into
developfrom
am/new-jasmine-stats
Aug 25, 2026
Merged

Use new Supplier-based jasmine API#503
amorison merged 46 commits into
developfrom
am/new-jasmine-stats

Conversation

@amorison

@amorison amorison commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Do not merge yet, this is still a work-in-progress.

This PR leverages the new Supplier-based API of jasmine-core to extract cross-sections and statistics.

This is a first major step in the direction of eliminating the need for the I*Source-based API (which in turns is responsible for gigantic switch statements and enums growing in the codebase when implementing those Source interfaces). This PR already eliminates the switch statement in Validator, replaced by directly using methods in Parameters to access the validation values.

Regressors still use the I*Source API as some more work is needed in jasmine-core to port those to a Supplier-based API. Porting regressors to this newer API will be the object of incoming PRs in jasmine and simpaths.

  • remove deprecated items in SimPaths where possible
  • check the GUI behaves as expected
  • confirm what's needed from fGiniEquivalisedHouseholdDisposableIncomeNational and other similar AccumulatorStats
  • eliminate use of deprecated jasmine API in SimPathsObserver (possibly in a follow-up PR)
  • check what's left to get rid of the *Source API
  • release new version of jasmine and make the first commit point to this version

@amorison
amorison force-pushed the am/new-jasmine-stats branch 4 times, most recently from 07d1ab7 to 7156b8b Compare August 18, 2026 19:10
@amorison

Copy link
Copy Markdown
Contributor Author

@dav-sonn This PR is now shaping up and I'm not expecting it to see much more changes. This is not ready to merge yet as I still need to release a new version of jasmine and plug this branch on that new version. However, since it already has all the changes I wanted to make for now, it would be extremely helpful if you could test the GUI on your end and check that it behaves appropriately (essentially that the values being plotted look reasonable). The bulk of the changes in this PR is essentially rewriting the way cross-sections are done and plotted in SimPathsObserver.

@amorison
amorison requested a review from dav-sonn August 19, 2026 09:59
@dav-sonn

Copy link
Copy Markdown
Collaborator

@dav-sonn This PR is now shaping up and I'm not expecting it to see much more changes. This is not ready to merge yet as I still need to release a new version of jasmine and plug this branch on that new version. However, since it already has all the changes I wanted to make for now, it would be extremely helpful if you could test the GUI on your end and check that it behaves appropriately (essentially that the values being plotted look reasonable). The bulk of the changes in this PR is essentially rewriting the way cross-sections are done and plotted in SimPathsObserver.

Hi @amorison,
As requested, I checked the GUI functioning on my end. Unfortunately, the parameters don't seem to be loading. See below the screenshot from the GUI:

Screenshot 2026-08-19 at 16 01 14

On IntelliJ, it shows the following error:

Screenshot 2026-08-19 at 16 01 40

I didn't investigate any of these errors further - I just thought of sharing this right away with you. Please let me know if there's anything you want me to double-check (or fix).

@amorison

Copy link
Copy Markdown
Contributor Author

Well, that's the error I run into on develop, so I assumed I was just missing data locally. Do you also have that error on develop?

@dav-sonn

Copy link
Copy Markdown
Collaborator

Well, that's the error I run into on develop, so I assumed I was just missing data locally. Do you also have that error on develop?

Fair point. I never use the model through the GUI, so I hadn't noticed it at all, but in fact the same error appears in develop. I do have the data, though... I will double-check with the rest of the team and get back to you.
Sorry about that.

@dav-sonn

Copy link
Copy Markdown
Collaborator

Well, that's the error I run into on develop, so I assumed I was just missing data locally. Do you also have that error on develop?

Fair point. I never use the model through the GUI, so I hadn't noticed it at all, but in fact the same error appears in develop. I do have the data, though... I will double-check with the rest of the team and get back to you. Sorry about that.

@amorison: after scraping all the latest commits, I found that the error was introduced in your PR #496, merged on 8 July.
If I understood correctly, JAS-mine 5.0.0 is stricter about parameter conversion and throws a ConversionException on UnionMatchingMethod, leaving the parameters panel blank.
On my end, I could fix the problem by carrying out the following modifications to /SimPaths/src/main/java/simpaths/experiment/SimPathsStart.java and /SimPaths/src/main/java/simpaths/model/SimPathsModel.java, respectively.

Screenshot 2026-08-20 at 18 16 05 Screenshot 2026-08-20 at 18 16 37

I don't know whether this is the neatest way, though. Also, while I could run the model with the GUI, I still got repeated errors like ERROR IntegerInvoker: Field demAge of object null must return an int value! or ERROR DoubleInvoker: Method getDemLifeSatScore0to10 of object null must return a double value!. My understanding (correct me if I'm wrong), however, is that they should disappear once am/new-jasmine-stats is merged.

Anyway, you certainly know better what the best solution is, so feel free to disregard my suggestions. Just let me know when you fixed this, so I can get back to reviewing the present PR (#503). Thank you!

amorison added a commit that referenced this pull request Aug 24, 2026
@amorison

Copy link
Copy Markdown
Contributor Author

@dav-sonn Thanks for looking into this. Your fix seems to work for now on this branch, with the warnings you saw on develop not appearing in this branch. However, some validation data appears to be missing from some plots. I'll try to investigate further.

amorison added a commit that referenced this pull request Aug 24, 2026
@amorison
amorison force-pushed the am/new-jasmine-stats branch from 3c17f1a to 01ecaeb Compare August 24, 2026 18:56
@amorison

Copy link
Copy Markdown
Contributor Author

@dav-sonn Seems like everything is fixed now, the missing validation data on some plots was just a silly mistake on my part. From what I could tell, the GUI behaves the same as on the develop branch now (provided your fix is applied). If you could have a quick check of the GUI yourself to confirm this looks alright, that would be great.

This is ready for review (although still not for merging as I still have to release a new version of jasmine and point to it before merging).

@amorison

Copy link
Copy Markdown
Contributor Author

@dav-sonn I had rebased this PR, please do not merge your local copy in this branch as this will result in duplicated commits. You can delete your local version of the branch before checking out the freshly fetched remote one to avoid merging outdated commits back in the PR.

@dav-sonn

Copy link
Copy Markdown
Collaborator

@dav-sonn I had rebased this PR, please do not merge your local copy in this branch as this will result in duplicated commits. You can delete your local version of the branch before checking out the freshly fetched remote one to avoid merging outdated commits back in the PR.

@amorison: I confirm everything works smoothly now. I still get the WARNING about com.formdev.flatlaf.util.NativeLibrary, but we agreed that it shouldn't be harmful.

amorison added a commit that referenced this pull request Aug 25, 2026
@amorison
amorison force-pushed the am/new-jasmine-stats branch from 01ecaeb to ad3459a Compare August 25, 2026 16:05
@amorison
amorison force-pushed the am/new-jasmine-stats branch from ad3459a to ce54bbc Compare August 25, 2026 16:16
@amorison
amorison marked this pull request as ready for review August 25, 2026 16:35
@amorison
amorison merged commit 2dbb01a into develop Aug 25, 2026
6 checks passed
@amorison
amorison deleted the am/new-jasmine-stats branch August 25, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants