feat: add support for Vensim's ALLOCATE BY PRIORITY function#809
Conversation
…here into feat/allocate-by-priority
|
@NiharikaHari: Thank you for your contribution! I have some high priority tasks to attend to for the next couple days, but I will try my best to review your work by Thursday. |
There was a problem hiding this comment.
Thank you @NiharikaHari for taking the time to contribute your work on this new function!
Most of my comments below are nitpicky things about code style. I haven't read the logic too closely for the _ALLOCATE_BY_PRIORITY C runtime function, but as long as it produces equivalent results to Vensim (and I can see that it does since the tests are passing), then I will trust that the logic works.
The test_js job is failing; that job does more than just run JS-related tests, it also runs the JS-level integration tests that exercise both C/Wasm and JS code gen, and there are Emscripten warnings flagged here (see build log) that will need to be resolved.
Also, please add at least one new test in gen-equation-c-from-vensim.spec.ts to verify that code gen works as expected. You can follow the patterns used in the existing should work for ALLOCATE AVAILABLE function (1D LHS, ...) test. Add your new test just after the last ALLOCATE AVAILABLE test in that file.
|
Thank you @chrispcampbell for taking the time to review this. I'll be able to work on these changes next week. The logic in |
|
@NiharikaHari This is a useful addition to SDE. Thank you for contributing! Does you model run now? |
|
@travisfranck Yes, it does! Outside of this I'm doing some janky changes around |
|
@chrispcampbell I have made the requested changes. The failures in |
Congrats! Again, thank you for contributing to SDE. |
chrispcampbell
left a comment
There was a problem hiding this comment.
I verified that you addressed all of the review comments. All good now, and the builds are successful. I will merge shortly and will publish new versions of the @sdeverywhere packages in a bit. Thanks again for contributing!

Fixes #792
Feature: Allocate by priority #792
allocate_availableimplementation for consistency.