sarahtattersall/PIPECore — pull request #7 by sjdayday (2014-07-05 23:14:08+00:00)
Title: Hierarchical nets

Hi Sarah,

This is early days on trying to add support for hierarchical nets -- nets that include other nets. Suppose we have net A that includes net B and C, and C includes D. "A" might look something like:
A
include B
include C
P0
T0
etc.
That allows us to edit and save A, without worrying about changes that might be made internally to B and C (or D). We might imagine that each of A, B, C, and D is opened in its own tab, and can be separately edited and saved.

But when it comes time to animate or analyze A we would want to create a PN that includes all the components of A, B, C and D. (Similarly, we could animate C, and it would include D's components). So, the include statements would be replaced with the components that they reference. To ensure uniqueness, we might prefix the components with the net name they came from, e.g., B.P0, C.T1, etc.

To keep these ideas straight, I'm thinking of the current PetriNet class as supporting the editing and persistence functions, and having a new class, ExecutablePetriNet, that has all the components of all the nets in the hierarchy, and supports animation and analysis modules.

That's where stuff is as of right now; I've begun shoving functions around, trying to find natural divisions between "editable" and "executable" functions. I haven't even started on the include logic yet...The tests run, but there's no way this is "right" (working on stuff right now that I can see is wrong, but there's lots I don't get). Very rough so far -- I have tons of questions! Hoping we can talk when you have time.

Steve