August 2024 Updates #513
chrispcampbell
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This month we published new versions of nearly all the
@sdeverywherepackages, which include some big new features and improvements.New JavaScript code generator
Until recently, the SDEverywhere transpiler only supported generating C code, and it was necessary to install and use the Emscripten compiler to transform that C code into WebAssembly that can be used in a JavaScript-based project.
In the latest
@sdeverywherepackages, there is now support for generating pure JavaScript code, so it is no longer necessary to install or use Emscripten to generate a working model. Now when you follow the "Quick Start" instructions, by default your project will be configured to generate JavaScript code. Thecreatetool still gives you the option of generating WebAssembly and will help you install the Emscripten SDK if desired.This change makes it even easier to get started working with SDEverywhere. For most small- to medium-sized models, the generated JavaScript code will have adequate performance. If you have a larger model that would benefit from the performance improvements provided by WebAssembly, it's still very easy to generate a WebAssembly model by setting
genFormat: cin yoursde.config.jsfile and includingplugin-wasmin your list of plugins.New support for Vensim
GAMEfunction and gaming modeI'm happy to report that we've implemented one of the most frequently requested features, which is full support for the Vensim
GAMEfunction and "gaming mode" in general.The new gaming mode features in SDEverywhere allow you to implement turn-based games and simulators that accept user input at defined times that influence the model during a model run. The new gaming mode support is very flexible and does not dictate a specific approach to the user interface; the
runtimepackage makes it easy to supply user inputs for one or moreGAMEvariables in your model, and you are free to design your user interface to accept those turn-based inputs however you would like.For a complete example of a web application that demonstrates the new gaming mode features, check out the new
house-gameexample, found under theexamplesdirectory in the repository.Or, for a more minimal example showing how to supply gaming inputs at runtime, check out the
game-inputsintegration test.New support for overriding lookup and data variables at runtime
As part of implementing the new gaming mode support described above, it is now possible to override (i.e., pass in new data points for) lookup and data variables after the model has been initialized. This feature is used for passing in user-supplied game inputs, but it can be used for many other purposes as well, such as providing custom lookup curves or updated exogenous data at runtime.
For a minimal example showing how to set new lookup data at runtime, check out the
override-lookupsintegration test.Other improvements
In addition to the new features listed above:
runtimepackages that should make it easier to add new features in the future.Looking forward
Now that these updates have been released, we are much closer to declaring "1.0" versions of all the
@sdeverywherepackages. Declaring "1.0" would mostly be a symbolic change, since the APIs have been quite stable for the last couple years. We are already following semantic versioning practices, but once we get to 1.0 we can adhere more closely to the usual major/minor/patch distinctions that are used in the npm ecosystem. More to come on that in a future update.Beta Was this translation helpful? Give feedback.
All reactions