Create and Play your PacMan Game with the GEMOC Studio Dorian Leroy 1 - - PowerPoint PPT Presentation

create and play your pacman game with the gemoc studio
SMART_READER_LITE
LIVE PREVIEW

Create and Play your PacMan Game with the GEMOC Studio Dorian Leroy 1 - - PowerPoint PPT Presentation

Create and Play your PacMan Game with the GEMOC Studio Dorian Leroy 1 Erwan Bousse 2 Manuel Wimmer 2 Benoit Combemale 3 Wieland Schwinger 1 1 JKU Linz 2 TU Wien 3 University of Toulouse (UT2J) September 17th 2017 Introduction Overview of the


slide-1
SLIDE 1

Create and Play your PacMan Game with the GEMOC Studio

Dorian Leroy 1 Erwan Bousse 2 Manuel Wimmer 2 Benoit Combemale 3 Wieland Schwinger 1

1JKU Linz 2TU Wien 3University of Toulouse (UT2J)

September 17th 2017

slide-2
SLIDE 2

Introduction Overview of the Approach Demo Conclusion

Context

Behavioral models often need to interact with the outside world during their execution, eg. to process incoming domain-level event occurrences Adds complexity to the operational semantics of a DSL:

impacts content and scheduling of execution rules, requires an interruption mechanism, requires an interface allowing external actors to send events.

Process message incoming message

Tedious and error-prone task that must be repeated for each executable DSL

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-3
SLIDE 3

Introduction Overview of the Approach Demo Conclusion

Context

Behavioral models often need to interact with the outside world during their execution, eg. to process incoming domain-level event occurrences Adds complexity to the operational semantics of a DSL:

impacts content and scheduling of execution rules, requires an interruption mechanism, requires an interface allowing external actors to send events.

Process message incoming message

Tedious and error-prone task that must be repeated for each executable DSL

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-4
SLIDE 4

Introduction Overview of the Approach Demo Conclusion

Context

Behavioral models often need to interact with the outside world during their execution, eg. to process incoming domain-level event occurrences Adds complexity to the operational semantics of a DSL:

impacts content and scheduling of execution rules, requires an interruption mechanism, requires an interface allowing external actors to send events.

Process message incoming message

Tedious and error-prone task that must be repeated for each executable DSL

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-5
SLIDE 5

Introduction Overview of the Approach Demo Conclusion

Example: The PacMan DSL

Execution Rules Abstract Syntax entities 0..* tiles 0..*

Board AbstractTile PassableTile WallTile Entity

+initialTile

Pacman Ghost

Execution Metamodel

PassableTile Ghost

targetTile 1 top 0..1 bottom 0..1 left 0..1 right 0..1

SuperPellet Pellet AbstractPellet

currentTile 1

AbstractTile

0..1 pellet

Tile Pacman

+pelletsEaten: int +lives: int +energized: boolean

Entity

+speed: int

Tile GhostHouseTile

merges run(Board: board) update(Board: board, int: deltaTime) update(Entity: entity, int: deltaTime) modifySpeed(Entity: entity, int: speed) activate(Ghost: ghost) energize(Pacman: pacman) enterNextTile(Entity: entity) imports initialTile 1 up(Pacman: pacman) down(Pacman: pacman) left(Pacman: pacman) right(Pacman: pacman)

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-6
SLIDE 6

Introduction Overview of the Approach Demo Conclusion

Example: The PacMan DSL

Execution Rules Abstract Syntax entities 0..* tiles 0..*

Board AbstractTile PassableTile WallTile Entity

+initialTile

Pacman Ghost

Execution Metamodel

PassableTile Ghost

targetTile 1 top 0..1 bottom 0..1 left 0..1 right 0..1

SuperPellet Pellet AbstractPellet

currentTile 1

AbstractTile

0..1 pellet

Tile Pacman

+pelletsEaten: int +lives: int +energized: boolean

Entity

+speed: int

Tile GhostHouseTile

merges run(Board: board) update(Board: board, int: deltaTime) update(Entity: entity, int: deltaTime) modifySpeed(Entity: entity, int: speed) activate(Ghost: ghost) energize(Pacman: pacman) enterNextTile(Entity: entity) imports initialTile 1 up(Pacman: pacman) down(Pacman: pacman) left(Pacman: pacman) right(Pacman: pacman) How to safely call these execution rules, while main execution loop of the game is ongoing?

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-7
SLIDE 7

Introduction Overview of the Approach Demo Conclusion

Problem and Idea

How to avoid rewriting operational semantics to define domain-specific events that may safely interrupt the execution flow? Idea Take the tedious and repetitive part out of the hands of the language engineer by providing: An annotation mechanism to easily define events, The generation of an interface to send events at runtime, Generic event management reusable across DSLs.

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-8
SLIDE 8

Introduction Overview of the Approach Demo Conclusion

Problem and Idea

How to avoid rewriting operational semantics to define domain-specific events that may safely interrupt the execution flow? Idea Take the tedious and repetitive part out of the hands of the language engineer by providing: An annotation mechanism to easily define events, The generation of an interface to send events at runtime, Generic event management reusable across DSLs.

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-9
SLIDE 9

Introduction Overview of the Approach Demo Conclusion

Summary of the Approach

A generative approach to obtain a domain-specific event language and its interpreter from annotated execution rules, A generic event queue manager, incorporating event queuing and dispatch into the execution loop.

EventQueueManager

processEvents() loop

EventInterpreter

[for evt in eventQueue] dispatchEvent(evt) canProcessEvent(evt) canProcess

  • pt

[canProcess] executeRule (evt.name,evt.params) manageEvents()

ExecutionEngine

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-10
SLIDE 10

Introduction Overview of the Approach Demo Conclusion

Event Metamodel and Interpreter Generation

The generative approach relies on annotated execution rules to locate event handlers and event preconditions. Event metaclasses are generated from event handlers to populate the event metamodel. An event interpreter mapping instances of event metaclasses to event handler and precondition calls is generated.

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-11
SLIDE 11

Introduction Overview of the Approach Demo Conclusion

Event Metamodel and Interpreter Generation

The generative approach relies on annotated execution rules to locate event handlers and event preconditions. Event metaclasses are generated from event handlers to populate the event metamodel. An event interpreter mapping instances of event metaclasses to event handler and precondition calls is generated.

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-12
SLIDE 12

Introduction Overview of the Approach Demo Conclusion

Event Metamodel and Interpreter Generation

The generative approach relies on annotated execution rules to locate event handlers and event preconditions. Event metaclasses are generated from event handlers to populate the event metamodel. An event interpreter mapping instances of event metaclasses to event handler and precondition calls is generated.

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-13
SLIDE 13

Introduction Overview of the Approach Demo Conclusion

Demo

...

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-14
SLIDE 14

Introduction Overview of the Approach Demo Conclusion

Conclusion & Future Work

Adapting semantics to event handling is difficult Proposed solution:

non-intrusive annotation of execution rules and generation of a generation of an interface to inject event occurrences reuse of an event queue and interruption mechanism

Eclipse Research Consortium GEMOC: sustains the GEMOC studio as a research platform to experiment on the globalization of, possibly executable and heterogeneous, modeling languages Contributors are welcome!

http://gemoc.org/ https://github.com/eclipse/gemoc-studio-modeldebugging

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)

slide-15
SLIDE 15

Introduction Overview of the Approach Demo Conclusion

Conclusion & Future Work

Adapting semantics to event handling is difficult Proposed solution:

non-intrusive annotation of execution rules and generation of a generation of an interface to inject event occurrences reuse of an event queue and interruption mechanism

Eclipse Research Consortium GEMOC: sustains the GEMOC studio as a research platform to experiment on the globalization of, possibly executable and heterogeneous, modeling languages Contributors are welcome!

http://gemoc.org/ https://github.com/eclipse/gemoc-studio-modeldebugging

Dorian Leroy , Erwan Bousse , Manuel Wimmer , Benoit Combemale , Wieland Schwinger JKU Linz, TU Wien, University of Toulouse (UT2J)