DiningPhilosophers

This page contains an applet that should appear as a separate window.

This model demonstrates the use of TransformationRule actors together with PortParameters. Initially, an empty model named "DiningPhilosophers" is generated by the ModelGenerator. A single dining philosopher with a fork is added to that empty model with the TransformationRule actor named "CreateFirst." The model is then passed to a loop, which adds n-1 philosophers and n-1 forks to it, one of each in each iteration. Each created philosopher is assigned a unique ID, which is generated by the Ramp and read into the second TransformationRule actor via a PortParameter. The up-to-date value of the PortParameter is used by the AttributeOperation in the Philosopher CompositeActor in the Replacement part. (Open the CreateOne actor, switch to the Replacement tab, right click on the Philosopher actor, and choose Customize->Operations.)

\ \ MoML specification for this model. \