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

Subclasses of Transition Model #22

Open
jacobnzw opened this issue Nov 20, 2020 · 0 comments
Open

Subclasses of Transition Model #22

jacobnzw opened this issue Nov 20, 2020 · 0 comments

Comments

@jacobnzw
Copy link
Owner

jacobnzw commented Nov 20, 2020

Problem

Having one class TransitionModel for both discrete and continuous simulation is messed up, because one has to have two methods (discrete and continuous) for dynamics functions, for Jacobians and for simulations. This creates confusion when subclassing TransitionModel for the user: should I implement dyn_fcn_cont in addition to dyn_fcn? Not to mention the same holds for Jacobians and simulation functions. And the class has to support discrete and continuous SDE simulation - not good!

Solution

Create subclasses of TransitionModel for discrete and continuous simulation, such as DiscreteTimeTransitionModel and ContinousTimeTransitionModel, and move the dynamics specification and the simulation routines there. The common functionality, such as setting of initial condition random variable and noise random variable, can remain in the parent class TransitionModel.

Classes and their method could look something like this:

TransitionModel

  • __init__(init_rv, noise_rv, noise_gain=None)
  • dyn_eval(xq, time, dx=False)
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