Connecting Conceptual Models using Relational Reference Attribute - - PowerPoint PPT Presentation

connecting conceptual models using relational reference
SMART_READER_LITE
LIVE PREVIEW

Connecting Conceptual Models using Relational Reference Attribute - - PowerPoint PPT Presentation

Ren Schne, Johannes Mey, Sebastian Ebert, Uwe Amann Connecting Conceptual Models using Relational Reference Attribute Grammars connector.relational-rags.eu October 16th 2020 Challenges when Designing Cyber-Physical Systems Distribution:


slide-1
SLIDE 1

René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann

Connecting Conceptual Models using Relational Reference Attribute Grammars

October 16th 2020

connector.relational-rags.eu

slide-2
SLIDE 2

Challenges when Designing Cyber-Physical Systems

Distribution: transparent communication with locally and remotely accessible models Multi-Paradigm: support for different paradigms and (programming as well as modelling) languages Fast, reactive behaviour: changes in input lead to automatic re-computation for fast reaction

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 2 / 12

slide-3
SLIDE 3

Challenges when Designing Cyber-Physical Systems

Hardware controller Software robot controller Application logic

Distribution: transparent communication with locally and remotely accessible models Multi-Paradigm: support for different paradigms and (programming as well as modelling) languages Fast, reactive behaviour: changes in input lead to automatic re-computation for fast reaction

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 2 / 12

slide-4
SLIDE 4

Challenges when Designing Cyber-Physical Systems

Safety expert Electrical engineer Mechanical engineer Application modeller

Distribution: transparent communication with locally and remotely accessible models Multi-Paradigm: support for different paradigms and (programming as well as modelling) languages Fast, reactive behaviour: changes in input lead to automatic re-computation for fast reaction

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 2 / 12

slide-5
SLIDE 5

Challenges when Designing Cyber-Physical Systems

Distribution: transparent communication with locally and remotely accessible models Multi-Paradigm: support for different paradigms and (programming as well as modelling) languages Fast, reactive behaviour: changes in input lead to automatic re-computation for fast reaction

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 2 / 12

slide-6
SLIDE 6

Use Case: An Robotic Application

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 3 / 12

slide-7
SLIDE 7

Use Case: An Robotic Application

External Model RAG

Safety Model

RAG

Application Model Robot Controller

speed trajectory state/part/7

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 3 / 12

slide-8
SLIDE 8

Use Case: Relational RAG [Mey2020] Safety Model

* SafetyZones * * RobotArm NewSpeed SafetyModel ZoneModel Zone Coordinate Position EndEffector Link Name CurrentPosition

Model ::= RobotArm ZoneModel ; ZoneModel ::= <Size:IntPosition> SafetyZone:Zone* ; Zone ::= Coordinate* ; RobotArm ::= Link* EndEffector /<NewSpeed:double>/ ; Link ::= <Name:String> <CurrentPosition:IntPosition> ; EndEffector : Link; Coordinate ::= <Position:IntPosition> ; External Model RAG

Safety Model

RAG

Application Model Robot Controller

speed trajectory state/part/7

[Mey2020] Johannes Mey, René Schöne, Görel Hedin, Emma Söderberg, Thomas Kühn, Niklas Fors, Jesper Öqvist, and Uwe Aßmann. Relational Reference Attribute Grammars: Improving Continuous Model Validation. Journal of Computer Languages (Jan. 2020). https://doi.org/10.1016/j.cola.2019.100940 Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 4 / 12

slide-9
SLIDE 9

Use Case: Relational RAG [Mey2020] Safety Model

syn boolean RobotArm.isInSafetyZone () { for (Link link : getLinkList ()) if (model (). getZoneModel () .isInSafetyZone(link.getCurrentPosition ())) return true; return model (). getZoneModel (). isInSafetyZone( getEndEffector (). getCurrentPosition ()); } syn boolean ZoneModel.isInSafetyZone(IntPosition pos) { for (Zone sz : getSafetyZoneList ()) for (Coordinate coordinate : sz.getCoordinateList ()) if (coordinate.getPosition (). equals(pos)) return true; return false; } syn double RobotArm.getNewSpeed () { return isInSafetyZone () ? LOW_SPEED : NORMAL_SPEED; } External Model RAG

Safety Model

RAG

Application Model Robot Controller

speed trajectory state/part/7

[Mey2020] Johannes Mey, René Schöne, Görel Hedin, Emma Söderberg, Thomas Kühn, Niklas Fors, Jesper Öqvist, and Uwe Aßmann. Relational Reference Attribute Grammars: Improving Continuous Model Validation. Journal of Computer Languages (Jan. 2020). https://doi.org/10.1016/j.cola.2019.100940 Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 4 / 12

slide-10
SLIDE 10

Use Case: Relational RAG [Mey2020] Safety Model

syn boolean RobotArm.isInSafetyZone () { for (Link link : getLinkList ()) if (model (). getZoneModel () .isInSafetyZone(link.getCurrentPosition ())) return true; return model (). getZoneModel (). isInSafetyZone( getEndEffector (). getCurrentPosition ()); } syn boolean ZoneModel.isInSafetyZone(IntPosition pos) { for (Zone sz : getSafetyZoneList ()) for (Coordinate coordinate : sz.getCoordinateList ()) if (coordinate.getPosition (). equals(pos)) return true; return false; } syn double RobotArm.getNewSpeed () { return isInSafetyZone () ? LOW_SPEED : NORMAL_SPEED; } External Model RAG

Safety Model

RAG

Application Model Robot Controller

speed trajectory state/part/7

?

[Mey2020] Johannes Mey, René Schöne, Görel Hedin, Emma Söderberg, Thomas Kühn, Niklas Fors, Jesper Öqvist, and Uwe Aßmann. Relational Reference Attribute Grammars: Improving Continuous Model Validation. Journal of Computer Languages (Jan. 2020). https://doi.org/10.1016/j.cola.2019.100940 Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 4 / 12

slide-11
SLIDE 11

Idea: Explicit Specification of Connections

R S S External Model R

speed

R

trajectory state/part/7

RAG

Safety Model

RAG

Application Model Robot Controller Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 5 / 12

slide-12
SLIDE 12

Idea: Explicit Specification of Connections

R S S External Model R

speed

R

trajectory state/part/7

RAG

Safety Model

RAG

Application Model Robot Controller

S R

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 5 / 12

slide-13
SLIDE 13

Solution: The DSL “RagConnect”

R receive Link.CurrentPosition using ParseState , Transform; ParseState maps byte[] bytes to RobotState {: return RobotState.parseFrom(bytes); :} Transform maps RobotState rs to IntPosition {: RobotState.Position p = rs.getPosition (); return IntPosition.of((int) (Math.round(p.getX() * 2)), (int) (Math. round(p.getY() * 2)), (int) (Math.round(p.getZ() * 2 - 0.5))); :} S send RobotArm.NewSpeed using CreateSpeedMessage , SerializeRobotConfig;

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 6 / 12

slide-14
SLIDE 14

Solution: The DSL “RagConnect”

R receive Link.CurrentPosition using ParseState , Transform; ParseState maps byte[] bytes to RobotState {: return RobotState.parseFrom(bytes); :} Transform maps RobotState rs to IntPosition {: RobotState.Position p = rs.getPosition (); return IntPosition.of((int) (Math.round(p.getX() * 2)), (int) (Math. round(p.getY() * 2)), (int) (Math.round(p.getZ() * 2 - 0.5))); :} S send RobotArm.NewSpeed using CreateSpeedMessage , SerializeRobotConfig;

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 6 / 12

slide-15
SLIDE 15

Solution: The DSL “RagConnect”

R receive Link.CurrentPosition using ParseState , Transform; ParseState maps byte[] bytes to RobotState {: return RobotState.parseFrom(bytes); :} Transform maps RobotState rs to IntPosition {: RobotState.Position p = rs.getPosition (); return IntPosition.of((int) (Math.round(p.getX() * 2)), (int) (Math. round(p.getY() * 2)), (int) (Math.round(p.getZ() * 2 - 0.5))); :} S send RobotArm.NewSpeed using CreateSpeedMessage , SerializeRobotConfig;

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 6 / 12

slide-16
SLIDE 16

Solution: The DSL “RagConnect”

R receive Link.CurrentPosition using ParseState , Transform; ParseState maps byte[] bytes to RobotState {: return RobotState.parseFrom(bytes); :} Transform maps RobotState rs to IntPosition {: RobotState.Position p = rs.getPosition (); return IntPosition.of((int) (Math.round(p.getX() * 2)), (int) (Math. round(p.getY() * 2)), (int) (Math.round(p.getZ() * 2 - 0.5))); :} S send RobotArm.NewSpeed using CreateSpeedMessage , SerializeRobotConfig; shared by both models

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 6 / 12

slide-17
SLIDE 17

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-18
SLIDE 18

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-19
SLIDE 19

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-20
SLIDE 20

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R 7

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-21
SLIDE 21

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R 7

send current value immediately

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-22
SLIDE 22

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R 7

send current value immediately

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-23
SLIDE 23

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); robotArm.addDependency1(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R 7

send current value immediately

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-24
SLIDE 24

Using the Generated API

RobotArm robotArm = ...; Link link1 = ...; robotArm.addLink(link1); robotArm.addDependency1(link1); link1.connectCurrentPosition("state/part/7"); robotArm.connectNewSpeed("robot/speed", true);

R S Broker

speed

External Model R

trajectory state/part/7

7 RAG

Safety Model

RAG

Application Model Robot Controller

S R 7

not necessary in future versions send current value immediately

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 7 / 12

slide-25
SLIDE 25

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-26
SLIDE 26

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-27
SLIDE 27

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-28
SLIDE 28

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-29
SLIDE 29

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-30
SLIDE 30

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-31
SLIDE 31

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-32
SLIDE 32

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-33
SLIDE 33

Inner Workings

Robot Controller R isInSafetyZone? Message (0.01, 0.03, 0.02) → (0, 0, 0) → false → speed = NORMAL (0.02, 0.04, 0.06) → (0, 0, 0) . . . . (0.02, 0.50, 0.06) → (0, 1, 0) → false . (0.02, 0.52, 0.06) → (0, 1, 0) . . . . (1.33, 1.00, 0.73) → (3, 2, 1) → true → speed = LOW 38 000 54 6

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 8 / 12

slide-34
SLIDE 34

Inner Workings (Evaluation)

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 9 / 12

slide-35
SLIDE 35

Inner Workings (Evaluation)

Video available at connector.relational-rags.eu

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 9 / 12

slide-36
SLIDE 36

Minimize Development Effort

Manually written After RagConnect After JastAdd

Lines of Code Safety Model Application Model

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 10 / 12

slide-37
SLIDE 37

Minimize Development Effort

Manually written After RagConnect After JastAdd

Lines of Code Safety Model Application Model

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 10 / 12

slide-38
SLIDE 38

Minimize Development Effort

Manually written After RagConnect After JastAdd

Lines of Code Safety Model Application Model

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 10 / 12

slide-39
SLIDE 39

Minimize Development Effort

Manually written After RagConnect After JastAdd

Lines of Code Safety Model Application Model

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 10 / 12

slide-40
SLIDE 40

Minimize Development Effort

Manually written After RagConnect After JastAdd

Lines of Code Safety Model Application Model

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 10 / 12

slide-41
SLIDE 41

Summary and Future Work

Problem: Constructing cyber-physical systems is difficult Challenges: Distribution • Multi-Paradigm • Fast, reactive behaviour Solution: Generation of model connectors R receive Link.CurrentPosition using ParseState , Transform; Use-Case: Robot with workflow and safety model

  • Development: 18 (28) DSL-code → 281 (701) Java-code
  • Runtime: 38 000 position updates → 54 re-computation → 6 speed messages

Future Work:

  • Remove unnecessary dependency definitions
  • Support additional communication protocols
  • Update complex parts of model (instead of only tokens)
R S S Broker speed External Model R R trajectory state/part/7 7 7 RAG Safety Model RAG Application Model Robot Controller

Now Future

Connecting Conceptual Models using Relational Reference Attribute Grammars René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann October 16th 2020 11 / 12

slide-42
SLIDE 42

René Schöne, Johannes Mey, Sebastian Ebert, Uwe Aßmann

Connecting Conceptual Models using Relational Reference Attribute Grammars

October 16th 2020

connector.relational-rags.eu