Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the workflow for simulation of MTGs #28

Closed
VEZY opened this issue Mar 13, 2023 · 0 comments
Closed

Define the workflow for simulation of MTGs #28

VEZY opened this issue Mar 13, 2023 · 0 comments

Comments

@VEZY
Copy link
Member

VEZY commented Mar 13, 2023

The current way of simulating MTGs is too slow because it makes a lot of copies.

The computation goes as follows:

1 . we attribute a ModelList to each node depending on its symbol using a Dict of Symbol => ModelList (a reference ModeList)
2. we compute a status based on the initialisation in the reference ModelList, and if some variables are missing, we eventually use the variables from the MTG attributes.

The thing is the status is always one time-step that we initialise with values at t, compute, extract and move to the attributes, initialise with the second time-step, and loop until all time-steps are simulated. That's a lot of copying.

What I propose now, is to pre-initialise all variables in the attributes using the status of the models, considering that attributes can exist or not (if not, use the value from the status). Then, pre-allocate the values according to the number of time-steps (a little bit like before) in the attributes. And then, to make a TimeStepTable that only references the values in the attributes so a change in these is reflected automatically on the attributes.

@VEZY VEZY closed this as completed in 64b0302 Mar 13, 2023
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

No branches or pull requests

1 participant