-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
namespace for states; transition function for #761 #836
Conversation
…e transition function
Next steps for this PR:
|
Ah, working on this reminded me of the other reason for the poststate designation. The poststates notionally need to be computed after a control variable is determined via a decision rule. I believe that this wrinkle will get smoothed over once we use the topological order of model variables, or some user-defined framing, to determine execution order. In the short term, I'm going to have to keep using the somewhat vague and overloaded 'poststate' category:
|
I have almost all the bugs worked out in the new implementation (i.e., most tests are passing) but I have a sticky issue I need feedback from @mnwhite about. It has to do with how the AgentType classes, now organized with Some things I notice:
Thanks in advance for any thoughts on this. |
Tests are now passing. There remains a design issue which has not be resolved in a satisfactory way yet. Model classes currently use a combination of explicitly defined state variables and inherited state variables. In the current pattern, the lists of 'state' variables are inherited in such a way that many downstream classes have dummy states used by ancestor's models, but unused themselves. This is messy. There is also a problem that in some places, the 'state variable' is defined by assignment to two dictionaries ( |
There seem to be some inconsistencies across the model classes in how inheritance is done. This makes it harder to have a consistent design for these things. I'm wondering if there's a specific reason why the constructor for |
Latest commit cleans up some of the However, locally this change breaks the Fast models developed by @alanlujan91 @alanlujan91 do you have any insight into why this may be happening? I have not touched the Fast classes directly in this PR. The main thing the most recent change does to the core classes is create a |
Progress: More testing has confirmed that before |
Ok. I figured out the problem. I had been building out the test suite in an incorrect way. The way it had been organized, the new tests I was writing (see #850) were running This was causing it to start with an already converged I believe that the way What I'm doing now is rewriting the test cases in the recommended way: the Separately, I wonder if @mnwhite agrees that this behavior of |
Nope, it's not that easy...(!) Now I've isolated the problem to Worse, it looks like there's some stochastic variation in |
The calculation of the What's happening here? |
The KS economy class had a bug. This bug is now fixed in this PR. |
There was an error in my transitioning of KS into the new state namespace. |
ugh. One more case to fix: the Portfolio model. |
The tricky issue here seems to be the handling of |
Ok. Tests are passing locally. Phew The issue was with how I was dealing with initialization and birth of I'll need to revisit this design while working on #838 (namespacing the control variables). Please merge #853 , new tests for ConsPortfolio model, before this PR. |
Addresses #761
Still working on this.