February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation.
Published byModified over 5 years ago
Presentation on theme: "February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation."— Presentation transcript:
http://chess.eecs.berkeley.edu/ February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation rule contains 3 components: 1.Pattern: match a subgraph in a given model 1)A graph containing interconnected actors and relations. 2)Matchers (e.g., C1 and C2 in SimplifyMultiply) can be used to match arbitrary actors satisfying certain criteria 3)Textual constraints are evaluated once a subgraph is found and for the match to be successful, all constraints must be true. 2.Replacement: replace the matched subgraph with a new graph 3.Correspondence: relate objects in pattern to replacement Model Transformation with the Ptera Controller Thomas H. Feng Edward A. Lee Ptera (Ptolemy Event Relationship Actor) A discrete-event model of computation for event-oriented designs (compared to actor-oriented, object-oriented, state-oriented, etc), originally introduced by Schruben in 1983. Semantics 1.Initialize event queue to contain only the initial events (green ones) 2.Repeat until event queue is empty 1)Remove the first event from event queue 2)Execute its action 3)For each outgoing edge whose guard is true Schedule the event that the edge points to 4)If the event is a final event (red one) Clear event queue Hierarchical Composition 1.An event can be associated with a refinement. The refinement is fired when: 1)the event is processed, or 2)input is received at any input port, or 3)the refinement itself requests (with fireAt) 2.Ptera as refinement of DE Event Library (Compared to Actor Library) Analysis Analyze the model and annotate it with properties (Jackie Leung and Thomas Mandl) Execution Control Execute the model Wait for a specified amount of real time Stop the transformation workflow Test the guards on the outgoing edges IO Clone the model List all files in the directory with filters Read the model stored in a file Output the model to a file User Interaction Pop up a dialog to ask the user for parameters Wait for user input but allow time to advance t Report a message in a window or a dialog Set window properties (on top, size, enabled, etc) Transformation Perform pattern matching and report result Perform pattern matching and transformation View the model in a separate window Generic Fire an action specified in the Ptolemy action language, and fire the submodel if there is one associated with it as a refinement Example Applications Ptera Simulate sequential discrete-event processes Compose with concurrent models of computation (DE, dataflow, etc) to specify parallel processes Describe dependency relationship between tasks in workflows Model Transformation Statically optimize models based on analysis result Construct new models (by transforming an empty model) Dynamically configure system structures according to the run-time states Simulate structural evolution of systems SimplifyMultiply SimplifyDivide RemoveMultiply And Much More… Events have an easy-to-extend API similar to actors. Override the fire method to perform customized action: public RefiringData fire(ArrayToken arguments) throws IllegalActionException;