A State Chart Simulator for Domotic Environments Dario Bonino, Fulvio Corno Politecnico diTorino, e-Lite research group http://elite.polito.it
May 18, 2015
A State Chart Simulator for Domotic Environments
Dario Bonino, Fulvio CornoPolitecnico di Torino, e-Lite research grouphttp://elite.polito.it
Motivations & Goals
IDE Modeling
Automatic model generation
Simulation support
Conclusions
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments2
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments3
“Environments where commercial domotic systems are extended with a low cost device (embedded PC) allowing integration and interoperation with other appliances, and supporting more sophisticated automation scenarios”
IDE design involves many conflicting aspects– User experience and satisfaction, Intelligent
behaviors, Automated scenarios, …
Complexity of interactions between involved systems– Not fully predictable
– Side effects often un-noticeable without deployment (simulation)
– Effectiveness depends on the designer experience
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments4
To provide support to validateautomation and intelligence for domotic environments
By means of IDE models offering
– Simulation capabilities
– Support to Formal Verification
Technology:
– Ontologies & UML2.0 State charts
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments5
DogOnt [ISWC08]
Ontology-based formal modeling of domotic environments (OWL)
– Technology independent device modeling
– Formally represents interoperation semantics through relations [AMI09]
– Supports automatic generation
of inter-operation rules [TCE09]
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments6
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments7
Sample Room
Lamp
Switch
OnOffFunctionality
OnNotification
OffCommand
OnOffNotificationFunctionality
OffNotification
OnOffState
OnOffState
hasState
OnCommand
hasFunctionality
hasCommandhasCommand
isInisIn
hasState
hasFunctionality
hasNotification
hasNotification
generatesCmd
generatesCmd
based on the state chart notation invented by David Harel in 1987– UML2.0 semantics
Specifically address the problem of representing large and complex reactive systems
Reactive System “ A reactive system is characterized by being to a large extent event-driven, continuously having to react to external and internal stimuli.”
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments8
They must respond
– To user actions and to environmental changes (external stimuli)
– To events generated by control algorithms (internal stimuli).
The control part of an IDE is a Reactive System
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments9
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments10
Sample Room
OffState
OnState
OffState
OnState
Lamp MachineSwitch MachineConnector
lampOn
lampOff
pressedOff /send(swOff)
pressedOn /send(swOn)
swOn /send(lampOn)
swOff /send(lampOff)
The behavior of each dogont:Controllable instance can be modeled as a StateDiagram
DogOnt Classes State diagram structure
– Template
DogOnt Instances State diagrams
– Template Instance (by state renaming)
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments11
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments12
SampleLamp1
OnOffFunctionality
OffCommand
OnOffStateLamp1
hasState
OnCommand
hasFunctionality
hasCommandhasCommand
&id;OffState
&id;OnState
Lamp Machine Template
&id;lampOn
&id;lampOff
OffStateValueLamp1
OnStateValueLamp1
hasStateValuehasStateValue
Lamp isA
IDE state diagrams can be automatically generated given
– A DogOnt IDE description
– A Library of Machine Templates
By exploiting
– SPARQL querying primitives for mapping device instances to state diagram templates
– Automatic connector generation
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments13
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments14
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments15
3 layers– Simulation Layer
• Runtime simulation (Apache Commons SCXML)
– Model Generation Layer• Generates SCXML
state diagrams from DogOnt
– Data Layer• DogOnt instances,• Template library• Generated SCXML
machine
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments15
6-room flat (Simple Home)• 95 domotic devices
• 1202 DogOnt instances
• 11 State diagram templates
• 384 States
• state space size ≈1080
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments16
Pellet (s) Jena (s)
Ontology loading & inference
19.458 6.152
Template Loading 0.007 0.007
Model Creation (SPARQL) 3.384 6.360
DogSim– Provides automatic generation of ready to
simulate IDE models– Exploits the DogOnt ontology to perform
automatic, semantic-based generalization of device machine templates
DogSim has been tested on a 6 room flat– 95 devices / 384 states– Feasible and applicable to real-world use cases
Future works– Model verification
3/28/2010DogSim: A State Chart Simulator for
Domotic Environments17