A Simple Discrete-Event Simulation: Part 45

Today I spent quite a lot of time updating the components so they could handle connections to multiple incoming and outgoing paths where appropriate. I was making some headway when I realized I needed to back up and review what I was doing. I spent the rest of the day figuring out how to make things more consistent, which means trying to use the same property and method names in the same order as much as possible, as well as implementing similar methods as close as possible to the same way. There is still a lot to do on that front, which I will hopefully finish tomorrow. I made a spreadsheet that listed all the characteristics for each component type, and the three sections of it are shown below. I made them scrollable so they remain readable but can also be viewed on smaller devices.

The first section shows how the main functions the components have in common incorporate mostly the same steps.

 
The second section shows all the properties currently used in the components, and whether they are common to most or all of the components or unique to that type.

 
The third section shows all of the methods used in the components, and whether they are common or unique to that type.

 
This work illustrates that there are still a lot of opportunities to polish things. Now that I have most of my thoughts in place in a semi-organized way I can also use this information to draw the connections out graphically — by hand, on paper, in this case — so I can get the clearest understanding of what I want to do.

There were a couple of side-tracks today as well. One involved the first bits of the routing system based on model logic vs. distribution logic. This idea has already been touched on in the mechanism the Arrivals component uses to distribute entities to the Entry components, but there are a few more shades of complexity to discuss and work through still.

The other involved changing the color of component lines or outlines to show their open status, which is the ability for components marked as “exclusive” to receive additional entities. This is just a hack for now because I’m using the (old version of) the data display mechanisms to stand in for the representation of the components. Doing that in a more visually appealing way, along with using the newer version of the data display mechanism, will make things a lot cleaner. The exclusivity logic is moderately tricky because I’m trying to plan for a lot of contingencies, including supporting this functionality across multiple incoming or outgoing connections. Again, drawing things out should help.

This entry was posted in Simulation and tagged . Bookmark the permalink.

Leave a Reply