A Simple Discrete-Event Simulation: Part 49

Today I was trying to sort out some of the issues I had outstanding for yesterday and came across the idea of setting the open status of collections of components (Path components and the non-Path component at which they terminate) based on comparing the number of entities in the system (component and paths) vs. the capacity of the terminating component. It was easy to come up with a method to count all the entities in that collection, and the routine even accounts for multiple, incoming Path connections. By making the same method recursive in the Path component the process can even count entities across multiple Path components in series. This applies to components that are flagged as exclusive, that have a finite capacity. This logic would not be needed for components that were non-exclusive and have an effectively infinite capacity.

It then occurred to me that setting the capacity of components to infinity (JavaScript supports this as a numerical value directly, but any sufficiently large number would work) or to a fixed value, and returning an actual count for exclusive components and zero for non-exclusive ones, might allow the same logic to be used in all cases in a way that would handle the open/not-open status of Path and non-Path components implicitly using simpler logic.

I’m still working my way through this thought process, drawing out the possibilities on paper. Two sticking points as I write this are how to chains of Path components in series and whether to store a flag in the entity marking it as cleared to proceed into a related collection of exclusive elements (Path components and non-Path terminating component). This is because I’ve required that individual components have individual open/not-open values so permissions have to be calculated and granted as an entity moves from component to component (especially along consecutive Path components).

Obviously I’ll let you know how it turns out. I may not actually implement this methodology but it’s worth exploring. Simpler and more streamlined is always better.

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

Leave a Reply