BuildACell / txtlsim

Cell-free expression modeling toolbox for MATLAB
0 stars 8 forks source link

Centralized parameter handling #27

Open murrayrm opened 7 years ago

murrayrm commented 7 years ago

Created by zoltuz on 2012-10-02

Reaction Rate Parameters

In simbiology there's two ways to introduce parameters to the reactions

  1. Parameter object added to Kinetic Law
    • Pros: In this way parameters are local and accessible for only one reaction.
    • Cons: To handle centralized parameters the array of parameters either should be global or passed into every single function along the way.
  2. Parameter object added directly to the model object
    • Pros: All the parameters can be added at one place in the code, but there're global.
      More organized code structure.
    • Cons: The parameters values inside the code aren't protected from the end-user. (All the latter added parameters and the original ones are in the same space, this might cause parameter override, etc)

More: http://www.mathworks.com/help/simbio/ref/parameterobject.html

Rules and other parameters

  1. About the simbiology rules can be easily added, where parameters can be dynamically computer according to the given rule. (Basically, if one of the parameters is the left side of a rule, than that parameter will calculated at simulation initialization or every time parameter is needed) More: http://www.mathworks.com/help/simbio/ref/ruletype.html

  2. Temperature, pH and other experiment related variables: I think they can be added directly to the model object as parameters to avoid passing them through each function.

Please, let me know what do you think about this!

murrayrm commented 7 years ago

Created by Vipul - 2012-10-02 Concerning method 2 for the reaction rate parameters: as far as I can tell, MATLAB does not have a way to protect variables within a given scope (Does anyone know of a way?). We could adopt a convention where all these Model Object level reaction rate parameters are capitalized, and state in the documentation that a user should not name any variables in capitalized form, to avoid any conflicts. Users usually use camelCase or underscores anyway..

murrayrm commented 7 years ago

Created by Richard Murray - 2012-10-03 For global parameters (temperature, pH, etc), I think we add these to the model object. But we have to think about what to do if/when there are multiple global objects in different tubes.

Choosing some naming convention for any global parameters is a good idea. We should do something simple (all caps, start with underscore, etc) to make it easy for users to avoid colliding. There are only two namespaces in simbiology I think: global to a model and local to a reaction.