1 / 34

Programmed Graph Rewriting with Time for Simulation-Based Design

Programmed Graph Rewriting with Time for Simulation-Based Design. Eugene Syriani Hans Vangheluwe. Programmed Graph Rewriting with Time for Simulation-Based Design. Eugene Syriani Hans Vangheluwe. Overview. Background In the context The Modular Timed Graph Transformation (MoTiF) language

damian
Download Presentation

Programmed Graph Rewriting with Time for Simulation-Based Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programmed Graph Rewriting with Time for Simulation-Based Design Eugene Syriani Hans Vangheluwe

  2. Programmed Graph Rewriting with Time for Simulation-Based Design Eugene Syriani Hans Vangheluwe

  3. Overview • Background • In the context • The Modular Timed Graph Transformation (MoTiF) language • Case Study: Reactive PacMan Game • Modelling, Simulation and Synthesis • Modelling of transformation and its environment • Simulation for optimization • Synthesis of application • Conclusion and Future Work

  4. In the context • Model Transformation  Graph Transformation • Controlled Graph Rewriting (rewriting rules) • Control Primitives : Sequencing, Branching, Looping, Parallelism, Hierarchy • Time is inherent in our transformation models Modelling, Simulation and Synthesis

  5. In the context Model of System Model of Environment Simulation Experiments Synthesis of Application

  6. Motif: Semantic Domain • The Discrete Event System Specification [1] (DEVS) formalism • Highly compositional simulation framework • DEVS: • Blocks • Ports • Events • Semantics: Parallel composition of blocks/models [1] Zeigler B.P., Multifacetted Modelling and Discrete Event Simulation/ Academic Press, London (1984)

  7. Motif: Semantic Domain • Atomic DEVS: • Time Advance • Output Function • Internal Transition • External Transition ATOMIC

  8. Motif: Semantic Domain Coupled DEVS C1 A1 C2 A2

  9. Motif [2] • Blocks • Atomic: encapsulate a graph rewriting rule • Coupled: encapsulate a set of rules (graph grammar) • Events • Inport: receive the host graph • Outport(s): send the transformed graph [2] Syriani E. and Vangheluwe H.: Programmed Graph Rewriting with DEVS. AGTIVE 2007, LNCS (2008)

  10. MotifModelling Environment in AToM3 [3] [3] de Lara J., Vangheluwe H., AToM3: A tool for multi-formalism and meta-modelling. FASE, LNCS 2306 (2002), 174-188

  11. Motif Execution class Pacmaneat: def match(): … def execute(): … class Pacmanmoveri: def match(): … def execute(): … class Pacmandie: def match(): … def execute(): … COMPILE IMPORT class Kill(ARule): def __init__(self): ARule.__init__(self, name=‘Kill') self.state = ARuleState(Pacdie()) def weightFunction(self): return 1.0 SIMULATE GENERATE

  12. Case Study: Reactive PacMan Game Simplified PacMan formalism [4] [4] Heckel R., Graph Transformation in a nutshell. FoVMT, ENTCS 148 (2006), 187-198

  13. 1 1 Case Study: Reactive PacMan Game 4 4 2 2 Build the Graph Rewriting Rules 5 pacLink pacLink 3 3 6 foodLink 1: Match[1].score + 1 5 pacLink 1 1 4 2 2 3 3 ghostLink ghostLink

  14. Case Study: Reactive PacMan Game Build the Graph Rewriting Rules ghostLink ghostLink 6 1 2 1 2 5 3 3 gridLeft gridLeft 4 4 pacLink pacLink 5 1 2 1 2 6 3 3 gridRight 4 gridRight 4

  15. Model of System Model of Environment Simulation Experiments Synthesis of Application

  16. Modelling of The transformation: System • User – Controller – Autonomous loop • Feed-back to User • On User interrupt: User Controlled • Feed-back to User User Controlled Autonomous

  17. Modelling of The transformation: Autonomous CRule Priorities

  18. Modelling of The transformation: GhostMoveCRule Decider finds the next move for the ghost Decider consumes time

  19. Modelling of transformation: System User Controlled Autonomous

  20. Modelling of The transformation: UserControlledCRule Conditional rule execution

  21. Modelling of The transformation: System User Controlled Autonomous

  22. Modelling of environment: User CoupledBlock • Customization • Modularity User Behavior User Interaction

  23. Model of the player: STRATEGY class Key: up = 'u' down = 'd' left = 'l' right = 'r' keys = [up, down, left, right] def nextRandom(self): import random return random.Random().choice(Key.keys) Smart Dummy Random

  24. Modelling of environment: UserBehaviorCoupledBlock Back-tracking Collector consumes time

  25. Modelling of environment: TryMoveCRule pacLink ghostLink pacLink 6 1 2 1 2 1 5 8 3 3 7 gridRight 4 gridRight 4 • Non-determinism

  26. Model of the player: SPEED Player reaction time [5]: • Thinking time • Motorics time • Slow • Normal • Fast • Very Fast [5] Zaitev A.V., Skorik Y.A., Mathematical description of sensorimotor reaction time distribution, Human Psychology 28(4) (2002), 494-497

  27. Model of System Model of Environment Simulation Experiments Synthesis of Application

  28. Why do we need simulation? We want to build a “playable” game • A.I. Strategy Random – Smart – Very Smart • Speed Too Slow – … – Too Fast Fix Strategy: Very Smart Find optimal speed

  29. SIMULATION results Finding the optimal game speed

  30. Model of System Model of Environment Simulation Experiments Synthesis of Application

  31. Synthesis of application • Synthesis of a reactive game • Discard the UserBehavior block • Runs on a web browser using AJAX and SVG • Real-time model transformation User Interaction User Behavior User Interaction

  32. Summary MoTiF allows for • Modelling and Simulation-Based Design • Graph transformation rules • Timed transformation system • User • Synthesis of applications • Reactive • Real-time Model Everything User Controlled Autonomous

  33. future work • Model A.I. behavior: backtracking  • Re-use and parametrisation of transformation models • MORE COMPLEX EXAMPLES

  34. ?

More Related