Wednesday, May 28, 2014

Group Meeting May 28


Today we had a group meeting and we talked about each student's project. For my presentation, I used the slides that can be found at Slides.


Monday, May 26, 2014

Weekly Log: May 19 - May 26

This week I was mainly doing some testing for the code I implemented the previous week. I created JUnit tests for the arrays plugin, dimension, and index classes. I created tests for the methods I implemented and one that creates a file, save to disk, and the read the file to make sure everything was saved. From the test cases, I found some problems with my code. Namely,

- Should I enforce that the model is always valid? At the current moment no. Users can create models that violate the specs (e.g. can create array dimension 3).  This is something validation should ensure. This is something I would like to do this summer. However, there are some cases where we want to make sure the user does not do something bad such as use the same id for two or more elements. If you use the same id 'x' for multiple objects and wanted to delete 'x,' which one of them are you referring to?

- Ids for dimension are locally scoped. Previously, I didn't allow the same id to be used multiple times for dimension objects. However, we want the id for dimensions to be locally scooped, meaning SBase 'x' can have a dimension with id 'i' and SBase 'y' can also have a dimension with 'i.' To account for this issue, I had to use the IdManager within JSBML to tell that it is okay to use the same id as long the dimensions are referring to different objects.

- The above condition implies that the Dimension class should not implement UniqueNamedSBase anymore.

- I also had issues with listOf attributes. For instance, when I have a list of CHILD, JSBML would normally refer the attribute to be 'listOfChilds' instead of 'listOfChildren.' I had to do a check in the plugin class for the case of listOf<Index> since the list attribute should be listOfIndices instead of listOfIndexs.

For the following week, I will be looking at the math necessary for the arrays package. That is, look at the JSBML compiler and figure out the steps needed to implement infix parsing. More info to come.

Sunday, May 18, 2014

Weekly Log: May 11 - May 17

This week, I implemented the main classes for the arrays package. I think during this process, I was able to understand the class hierarchy much better.  The arrays package is pretty simple:

SBase is extended to have 0 or 1 list of dimensions, where the list contains 0 or more dimension objects and dimension inherits from SBase. Dimension is used to indicate an element is arrayed. The id and name are optional fields. The size of an dimension is an referenced to an Sid object. Currently, the size has to be scalar and constant. The array dimension is used to indicate which dimension you are referring to. Currently, the array dimension is limited to have at most three dimensions.

Similarly, SBase is extended to have 0 or 1 list of indices, where the list contains 0 or more index objects and index inherits from SBase. Index is used to reference an element. You specify which attribute (e.g. variable) you are referencing. Array dimension is the same for dimension. The math is used to determine the index value for the referenced element.

This is easier to understand through an example:

n = 5;

int[] y = new int[n];

for(int i = 0; i < n; i++)
  y[i] = i;

To encode this using the arrays package in SBML, n would be a constant parameter, y would have a dimension of size n and arrayDimension would be 0 (1-D array). In the loop, we have an assignment rule where we index the ith element of y and set it to i.

In order to do this in JSBML, I created a plugin for the arrays package, which is used as a place holder for new attributes. In this case, the the attributes are list of dimensions and indices. I created a dimension object with the required fields shown on the UML diagram. Dimension extends AbstractNamedSBase because it can have id and name and implements UniqueNamedSBase to enforce that the identifier associated with the dimension object is unique. Index extends AbstractMathContainer which is a base class for everything that contains math. For both the dimension and index classes, I created getter/setter methods for each field and implemented the abstract methods.

The next step is to throughly test everything.

Tuesday, May 13, 2014

Project Description

I just realized that I made the mistake of not describing the project I will be working on this summer. I proposed the implementation of the arrays package within JSBML since SBML core lacks an efficient representation of regular structures (elements that are used over and over).  Of course the arrays package is just syntactic sugar to the modeling language, just like the Hierarchical Model Composition package, which is an extension in SBML to construct hierarchical models.
This means that you can construct the exact same models without these packages. However, from the modeling standpoint, it becomes much easier to design models when you can construct models hierarchically and in arrays form, especially when you want to model a population of cells.

The arrays package is used to avoid the tedious work of copying over something multiple times. I think arrays is good when you want to indicate multiple elements share the same attributes since X[0] and X[1] are referring to X where as X_0 and X_1 could be two completely different things (this would be bad practice but name conventions are suggested, not enforced).

The arrays package has been proposed.  In order for the arrays package to be officially integrated into SBML, two modeling tools have to support the package. Hopefully, other tools make use of the arrays package because I think it is a nice feature. Also, I hope that the arrays package helps revive the Dynamic Structures package, which is currently stalled (there are some nice discussion about this package though).

Sunday, May 11, 2014

Weekly Log: May 4 - May 9

I was very excited when I found out I was accepted into the Google Summer of Code program.
Currently, we are in the period that Google calls Community Bonding, which is a period that we get to know our mentors. I had a virtual meeting with my mentors Chris and Nico this past week. It was pretty helpful talking to them, as I was able to ask a couple of questions and also get some directions as to what I am supposed to be doing for the rest of the week. Prior to that, I had a meeting with everyone participating in the JSBML projects for GSoC. We, the students, got to meet with each other and talk about what we will be working on this summer. We also got help setting up the project on our machines.

Last week I was studying the classes for a couple package extensions that were already implemented to SBML core since I will be implementing the arrays package. First impression is that it is going to be straightforward to implement the necessary classes for arrays. However, I expect that there will be some tricky parts in the future. My mentors instructed me to read the user guide for JSBML. The user guide contains the information necessary for implementing extensions for JSBML. I was pretty impressed how detailed the user guide is. I was able to make the skeleton of the arrays extension.

Thursday, May 8, 2014

Introduction

Hello all,

My name is Leandro Watanabe. I recently graduated with a bachelor's degree in Computer Engineering/Computer Science from the University of Utah. This summer, I will be helping the JSBML community with the implementation of the arrays package. This package will allow the to representation of regular constructs more efficiently in SBML models, which is a current limitation of SBML core. I will be helping the implementation of the Java version of SBML.

I am very excited for this opportunity and looking forward to working with the mentors and other students involved in projects related to JSBML. I think it will be a great summer!