Simultaneous Scenario Comparison Feature #624
-
|
Hi, I'm developing an Interactive Simulation Environment for an Integrated Assessment Model using the SDEverywhere tool, and I'd appreciate your advice on an important feature, as experts in SDEverywhere's codebase. The feature I want to incorporate in the ISE is this: I'd like users to be able to compare the results of two distinct input configurations (scenarios) in a single graph. I'm currently implementing an approach, where I basically initialize two model instances (instead of one) in index.js when the app loads: I've also extended the CSV parsing logic of the package "@sdeverywhere/plugin-config" so that more columns are parsed in graphs.csv. This is an example of how graphs.csv looks like: (!) the "scenario" column links each row to its corresponding scenario. There's a handful of additional changes, but I won't go into more detail here. The above approach works (and it is -- rather -- simple in implementation) but it creates some inefficiencies that I'd preferably avoid. I'll try to explain briefly. In the ideal solution:
However, in the current implementation, model1 generates output variables for scenario 1 AND scenario 2, and model2 does the same. As a result, instead of having (ideally) 2x output variables (one set for each scenario), we end up having 4x output variables. (We have 2 extra sets of outputs that are unnecessary and are not shown in the graphs at all.) So, the current approach doubles resource usage compared to an ideal solution, as each model instance processes both scenarios. (!) I've also tried utilizing a single row in graphs.csv for both scenario1 and scenario2, but I can't think of a way to "split" a single graphId into two separate running models. The questions I have for you (and feel free to be as broad or as specific/technical as you want) are the following:
Here's a link to the ISE: https://ntantaroudas.github.io/choice-web/ Thank you very much for your time and any pointers you can share! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Hi @philmard, thanks for your detailed message; you've come to the right place and I'd be happy to help! I was really glad to hear that your project is using SDEverywhere. It's always cool to see different kinds of UIs and use cases built on top of SDEverywhere. It just so happens that we've had some code to support one of our internal projects that should help with your situation. I had plans to migrate that code into the public SDEverywhere repo and finally got back to working on that last week. I'm hoping to wrap up the changes today or early tomorrow and will post a more detailed reply soon after. I'll also provide answers to your questions at that time so that I can reference the newly added runtime API and sample code. Stay tuned! |
Beta Was this translation helpful? Give feedback.
-
|
@philmard I'm curious what IAM your using. It would be great to know the name and/or subject (climate, health, energy etc) that of it. And you're able to share what group it is. Small effort at building a SDE community. ;). Thanks. |
Beta Was this translation helpful? Give feedback.
@philmard: I published new versions a couple packages, along with a new Svelte-based project template/demo, to help support your use case.
I added a new
MultiContextModelSchedulerclass to the@sdeverywhere/runtimepackage. This class allows you to more efficiently have multiple contexts (input/output scenarios) in your app while using the same underlying model instance. See #625 for details.I updated
@sdeverywhere/plugin-configso that you can now set the "plot N source" ingraphs.csvto something like "Scenario1" or "ScenarioN", and it will get treated like a normal output variable, but allows your app to choose an output associated with a particular scenario/context. See #626 for …