Management of Wireless Software Components - Fabien Romeo's

Deployment on constrained devices (PDA, mobile phones, …) Model-Driven Engineering philosophy. The components' behavior is designed with UML State.
2MB taille 2 téléchargements 242 vues
DAIS, Paphos, Cyprus, 6 June 2007

Observability and Controllability of Wireless Software Components Fabien Romeo Liuppa, Université de Pau

[email protected] www.fromeo.fr

1

DAIS, Paphos, Cyprus, 6 June 2007

Background Component-Based Software Engineering (CBSE) «A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties. » — Szyperski et al (2002).

CBSE applied to Wireless Systems (WS) WS are heterogeneous systems and software componentization allows adaptation WS are dynamic and open systems, and as such, they often use Service-Oriented Architecture, which relies on software components (eg. OSGi bundles) [email protected] www.fromeo.fr

2

DAIS, Paphos, Cyprus, 6 June 2007

The need for management in WS Toward Open-World Software: Issues and Challenges (IEEE Computer Magazine, October 2006): « A highly dynamic and open system necessitates runtime monitoring to watch for situations that might require suitable reactions to assure the desired level of global quality. […] As a result of monitoring, it should be possible to handle deviations from expected behaviors and plan for a reconfiguration. » —Luciano Baresi, Elisabetta Di Nitto, and Carlo Ghezzi I. Crnkovic, “Component-based Software Engineering for Embedded Systems,” in ICSE’05. A. Möller, J. Fröberg, and M. Nolin, “Industrial Requirements on Component Technologies for Embedded Systems,” in CBSE’04. [email protected] www.fromeo.fr

3

DAIS, Paphos, Cyprus, 6 June 2007

Management in CBSE Maintaining component-based systems is a difficult problem – Voas (1998) Black-boxes, in particular COTS components No communication between providers and assemblers Management is often an after-thought

Three kinds of approaches in the literature: based on the components’ infrastructure Lifecycle management, low-level states (attributes) access

based on the application’s architecture Components reify the architecture, control by replacement

based on the components’ behavior External observations are confronted against behavior models

[email protected] www.fromeo.fr

4

DAIS, Paphos, Cyprus, 6 June 2007

Our proposal A runtime management infrastructure Address the internal behavior of software components Wireless remote access Deployment on constrained devices (PDA, mobile phones, …)

Model-Driven Engineering philosophy The components’ behavior is designed with UML State Machines Direct execution and control of components’ behavior by their internal managers which embed a PauWare Model Execution Engine The same models designed at development time are retrieved at runtime for management purpose [email protected] www.fromeo.fr

5

DAIS, Paphos, Cyprus, 6 June 2007

Wireless Software Component’s Architecture external application port provided interface

internal effector

Business Component

required interface

external effector

Managed Component

internal pulled sensor

Internal Manager

internal internal management internal pushed sensor management port port

[email protected] www.fromeo.fr

external pulled sensor

external management port

external pushed sensor

6

DAIS, Paphos, Cyprus, 6 June 2007

Statecharts [Harel 1987] : Statecharts = state-diagrams : XOR

+ depth : hierarchie

restart/

create/

On

stop/

On Off

destroy/

+ orthogonality : AND On

Wait

Process request /

+ broadcast-communication :

Listen request / Queue->add(client)

Wait

Process

Asynchronous Communication Notation: ^signal

[Queue->isNotEmpty] /

[email protected] www.fromeo.fr

7

DAIS, Paphos, Cyprus, 6 June 2007

The PauWare Engine Power the execution of Statecharts models (simulation, verification, implementation) All-terrain Java Implementation (J2EE, J2SE et J2ME) PauWare Engine PauWare Library Statecharts

Model of the application dynamics [email protected] www.fromeo.fr

8

DAIS, Paphos, Cyprus, 6 June 2007

The PauWare Library Declaration of states :

Statechart

Classes Statechart and Statechart_monitor

Composition of states :

Statechart_monitor

XOR and AND operators

Declaration of transitions : fires(String event, Statechart from, Statechart to, boolean guard, Object target, String action, Object[] args);

Generation of events : _statechart_monitor.run_to_completion("event");

[email protected] www.fromeo.fr

9

DAIS, Paphos, Cyprus, 6 June 2007

Example : Light Light turnOff

On

Off Off

On

do / display turnOn

/* UML statecharts */ Statechart _On = new Statechart("On"); _On.doActivity(this,"display"); Statechart _Off = new Statechart("Off"); _Off.inputState(); /* PauWare engine */

Statechart_monitor _Light = new Statechart_monitor(_On.xor(_Off),"Light"); /* UML transitions */ _Light.fires("turnOn",_Off,_On); _Light.fires("turnOff",_On,_Off);

/* the code is incomplete */ /* UML events */ public void turnOn() throws Statechart_exception { _Light.run_to_completion("turnOn"); } public void turnOff() throws Statechart_exception { _Light.run_to_completion("turnOff"); } [email protected] www.fromeo.fr

10

DAIS, Paphos, Cyprus, 6 June 2007

PauWare Component Model « interface » Light functional interface turnOn() turnOff()

Light turnOff

Light

On

Off Off

On

do / display

« implement »

turnOn

« class » Light implementation class « service » turnOn() « service » turnOff() « action » display() _Light

1

Internal Manager [email protected] www.fromeo.fr

1 _StateMachine

_Composytor::Statechart_monitor 11

DAIS, Paphos, Cyprus, 6 June 2007

PauWare → WMX PauWare with JMX provides a management framework for non-wireless components Too much for constrained devices

Not feasible

PauWare Java Reflexion Mechanisms JMX Web Server

Java ME [email protected] www.fromeo.fr

12

DAIS, Paphos, Cyprus, 6 June 2007

WMX Wireless Management eXtensions http://wmx.fromeo.fr Application Side

Management Side

Controle

Management Interface

Manager Statechart

Monitor

Java ME [email protected] www.fromeo.fr

Java SE 13

DAIS, Paphos, Cyprus, 6 June 2007

Demo : Traffic Light

[email protected] www.fromeo.fr

14

DAIS, Paphos, Cyprus, 6 June 2007

WMX: new problems Wireless Management eXtensions http://wmx.fromeo.fr Unreliable Communication: Asynchronous Mode ?

Controle

Management Interface

Manager Statechart

Monitor

Replication ? Coherence ? [email protected] www.fromeo.fr

What to transmit and how ? - Events ? - States ?

15

DAIS, Paphos, Cyprus, 6 June 2007

Coherence of statecharts (1) Application Side

turnOff

Management Side

Forwarding events causes problems with guards

Unknown?

Component

Component

turnOff [component.temperature < 40]

On

On

turnOff [component.temperature < 40]

On

Off Off

On

Off Off

event turnOn

turnOff

turnOn

component.temperature = 43 And we don’t want to send low-level states (attributes) [email protected] www.fromeo.fr

16

DAIS, Paphos, Cyprus, 6 June 2007

Coherence of statecharts (2) Application Side

turnOff

Management Side

If we forward the transitions…

Component

Component

turnOff [component.temperature < 40]

On

On

On

Off Off

On

Off Off

transition turnOn

component.temperature = 43 as we still don’t want to send low-level states (attributes)… [email protected] www.fromeo.fr

17

DAIS, Paphos, Cyprus, 6 June 2007

Coherence of statecharts (3) Application Side

turnOff

Management Side

… the statecharts are synchronized …

Component

Component

turnOff [component.temperature < 40]

On

On

On

Off Off

On

Off Off

transition turnOn

On → Off

component.temperature = 39 we didn’t have to send low-level states (attributes) [email protected] www.fromeo.fr

because the internal manager handled them for us… 18

DAIS, Paphos, Cyprus, 6 June 2007

Composition Management Desynchronization of automates (example : Traffic Light) Undetectable Error by Model Checking It is supposed to work

Shows the possibility to define management policies based on the replicated statechart

[email protected] www.fromeo.fr

19

DAIS, Paphos, Cyprus, 6 June 2007

States – Sub-states (1)

RedLight turnOff

On

Off Off

On

do / display turnOn

TrafficLight Start

goRed/ ^RedLight.turnOn

entry: goRed

YellowLight turnOff

Red goRed/^RedLight.turnOn, ^YellowLight.turnOff

goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff

On do / display

Yellow goYellow/^YellowLight.turnOn, ^GreenLight.turnOff

Off Off

On

turnOn

GreenLight

Green

turnOff

On

Off Off

On

do / display turnOn [email protected] www.fromeo.fr

20

DAIS, Paphos, Cyprus, 6 June 2007

States – Sub-states (2)

RedLight turnOff

On

Off Off

On

do / display turnOn

TrafficLight Start

goRed/ ^RedLight.turnOn

entry: goRed

YellowLight turnOff

Red goRed/^RedLight.turnOn, ^YellowLight.turnOff

goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff

On do / display

Yellow goYellow/^YellowLight.turnOn, ^GreenLight.turnOff

Off Off

On

turnOn

GreenLight

Green

turnOff

On

Off Off

On

do / display turnOn [email protected] www.fromeo.fr

21

DAIS, Paphos, Cyprus, 6 June 2007

States – Sub-states (3)

RedLight turnOff

On

Off Off

On

do / display turnOn

TrafficLight Start

goRed/ ^RedLight.turnOn

entry: goRed

YellowLight turnOff

Red goRed/^RedLight.turnOn, ^YellowLight.turnOff

goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff

On do / display

Yellow goYellow/^YellowLight.turnOn, ^GreenLight.turnOff

Off Off

On

turnOn

GreenLight

Green

turnOff

On

Off Off

On

do / display turnOn [email protected] www.fromeo.fr

22

DAIS, Paphos, Cyprus, 6 June 2007

Composite Manager CompositeManager in(state) / ^managed.in(state)

Monitor

Control

to_state(state) / ^managed.to_state(state)

state_changed(transition) execute(action) / ^managed.execute(action)

part_state_changed [not valid_state_guard]

Undefined State Composition

check / ^self.to_state(state) [consistency_guard]

Defined State Composition

part_state_changed / ^self.check [valid_state_guard]

consistency_guard = [( !(state = compositeState1) && valid_state_guard = [( part1Manager.managedIn(part1ComposedState1) && … && partNManager.managedIn(partNComposedState1) ) || … || ( part1Manager.managedIn(part1ComposedStateN) && … && partNManager.managedIn(partNComposedStateN) )]

!(self.managedIn(compositeState1)) && part1Manager.managedIn(part1ComposedState1) && … && partNManager.managedIn(partNComposedState1) ) || … || ( !(state = compositeStateN) && !(self.managedIn(compositeStateN)) && part1Manager.managedIn(part1ComposedStateN)

[email protected] www.fromeo.fr

&& … && partNManager.managedIn(partNComposedStateN) )] 23

DAIS, Paphos, Cyprus, 6 June 2007

Part Manager PartManager in(state) / ^managed.in(state)

Monitor

state_changed(transition) / ^CompositeManager.part_state_changed

Control

to_state(state) / ^managed.to_state(state)

execute(action) / ^managed.execute(action)

[email protected] www.fromeo.fr

24

DAIS, Paphos, Cyprus, 6 June 2007

Performances? Deployed on a HP iPAQ hx4700 JVM IBM J9

Complex Case Studies : Home automation system Railcar System (J2EE + JMS) …, your system T1

R1

Terminal

Railcar

Railcar

new destination(another terminal) go

Railcar

new destination(another terminal) go

Cruising entry/ ^cruiser.set Engaged80

Cruising

terminal crossing

entry/ ^cruiser.set Engaged80 alert100(terminal,railcar,is clockwise)

Cruising

go

T4

terminal crossing

entry/ ^cruiser.set Engaged80 alert100(terminal,railcar,is clockwise)

Arriving

terminal crossing

alert100(terminal,railcar,is clockwise)

Counterclockwise

Arriving Wait for terminal order alert80(terminal,railcar,is clockwise)/ Wait for terminal Wait for alert80 ^my next possible stop.approaching(terminal,railcar,is clockwise) entry/ ^cruiser.set Engaged20 order alert80(terminal,railcar,is clockwise)/ go on/ ^cruiser.set Engaged20 Wait for terminal Wait for alert80 ^my next possible stop.approaching(terminal,railcar,is clockwise) entry/ ^cruiser.set Engaged20 order go on/ ^cruiser.set Engaged20 Stopped on railway terminal stopping/ ^cruiser.set Disengaged alert80(terminal,railcar,is clockwise)/ ^my next possible stop.approaching(terminal,railcar,is clockwise)

Wait for alert80

Arriving

entry/ ^cruiser.set Engaged20

go on/ ^cruiser.set Engaged20 terminal stopping/ ^cruiser.set Disengaged terminal stopping/ ^cruiser.set Disengaged

Stopped on railway

stop/ ^cruiser.set Disengaged

exit/ ^cruiser.set Engaged20

Stopped at terminal exit/ ^cruiser.set Engaged20

[email protected] www.fromeo.fr

Stopped at terminal exit/ ^cruiser.set Engaged20

^clockwise ingoing vehicle.go on, ^counterclockwise entry/ unset my current railcar time-out(30000)/ ingoing vehicle.go on terminal crossing(terminal,railcar,is clockwise)/ ^railcar.terminal^timer.to crossing be killed, ^my current railcar.go, Idle ^clockwise ingoing vehicle.go on, ^counterclockwise entry/ unset my current railcar time-out(30000)/ ingoing vehicle.go on ^timer.to be killed, ^my current railcar.go, approaching(terminal,railcar,isIdle clockwise)/ set my current railcar(is clockwise) ^clockwise ingoing vehicle.go on, ^counterclockwise entry/ unset my current railcar time-out(30000)/ ingoing vehicle.go on ^timer.to be killed, ^my current railcar.go, approaching(terminal,railcar,isIdle clockwise)/ set my current railcar(is clockwise) ^clockwise ingoing vehicle.go on, ^counterclockwise ingoing vehicle.go on entry/ unset my current railcar Busy entry/ ^clockwise ingoing vehicle.stop, ^counterclockwise approaching(terminal,railcar,is clockwise)/ set my current ingoing railcar(isvehicle.stop clockwise)

R3

Busy

entry/ ^clockwise ingoing vehicle.stop, ^counterclockwise approaching(terminal,railcar,is clockwise)/ set my current ingoing railcar(isvehicle.stop clockwise)

Busy

T3

entry/ ^clockwise ingoing vehicle.stop, ^counterclockwise ingoing vehicle.stop

Busy

entry/ ^clockwise ingoing vehicle.stop, ^counterclockwise ingoing vehicle.stop

Stopped on railway stop/ ^cruiser.set Disengaged stop/ ^cruiser.set Disengaged

Stopped at terminal

R2

alert100(terminal,railcar,is clockwise) new destination(another terminal) Terminal alert100(terminal,railcar,is clockwise) new destination(another terminal) Terminal alert100(terminal,railcar,is clockwise) terminal crossing(terminal,railcar,is clockwise)/ ^railcar.terminal crossing new destination(another terminal) Terminal alert100(terminal,railcar,is clockwise) T2 terminal crossing(terminal,railcar,is clockwise)/ ^railcar.terminal crossing new destination(another terminal) time-out(30000)/ terminal crossing(terminal,railcar,is clockwise)/ ^railcar.terminal^timer.to crossing be killed, ^my current railcar.go, Idle

new destination(another terminal)

Clockwise

approaching(terminal,railcar,is clockwise) terminal stopping(terminal,railcar,is clockwise)/ ^timer.to be set(30000), ^my current railcar.terminal stopping approaching(terminal,railcar,is clockwise) terminal stopping(terminal,railcar,is clockwise)/ ^timer.to be set(30000), ^my current railcar.terminal stopping approaching(terminal,railcar,is clockwise) terminal stopping(terminal,railcar,is clockwise)/ ^timer.to be set(30000), ^my current railcar.terminal stopping approaching(terminal,railcar,is clockwise)

25

terminal stopping(terminal,railcar,is clockwise)/ ^timer.to be set(30000), ^my current railcar.terminal stopping

DAIS, Paphos, Cyprus, 6 June 2007

Performances – Quantitative Study Benchmark 100.000 loops of state changes (adapted from JAC Benchmark) Intel Centrino 1600MHz, 512 Mo RAM, WinXP, JVM 1.5 SUN Implementation

Benchmark

Overhead per state change Pure Java 2 ms 0 μs Java + reflect API 14 ms 0,12 μs JMX (internal access) 721ms 7,19 μs PauWare (w/o cache) 1491 ms 14,89 μs PauWare (w cache) 1027 ms 10,25 μs Velcro (w/o cache) 1529 ms 15,27 μs Velcro (w cache) 1038 ms 10,36 μs Following implementations include I/O or networking Pure Java + System.out.print() 2584 ms 25,82 μs WMX (velcro + sockets) JMX + RMI connector [email protected] www.fromeo.fr

3893 ms 22077ms

38,91 μs 220,75 μs 26

DAIS, Paphos, Cyprus, 6 June 2007

Conclusion PauWare Components driven by executable statecharts But also a framework for experimenting research results in MDA, CBSE, …

Velcro + WMX Management of the software components’ behavior in the context of wireless systems

Perspectives Integration into other component models (OSGi, Fractal, …) Persistence at runtime of other types of models, (other views for management) Autonomic Computing: a solution to put the human on the loop… [email protected] www.fromeo.fr

27

[PauWare] « Power is not a means, it is an end. » — George Orwell, Nineteen Eighty-Four

DAIS, Paphos, Cyprus, 6 June 2007

Thank you for listening! Fabien Romeo, Franck Barbier, Jean-Michel Bruel, Observability and Controllability of Wireless Software Components, 7th IFIP Conference on Distributed Applications and Interoperable Systems, Paphos, Cyprus, 5-8 june, 2007. Code available at

http://www.pauware.com http://wmx.fromeo.fr

[email protected] www.fromeo.fr

28

DAIS, Paphos, Cyprus, 6 June 2007

Bonus Track…

[email protected] www.fromeo.fr

29

DAIS, Paphos, Cyprus, 6 June 2007

Velcro PauWare

java.lang.reflect

PauWare PauWare (java.lang.reflect) (java.lang.reflect)

[email protected] www.fromeo.fr

Velcro Velcro

Velcro

30

DAIS, Paphos, Cyprus, 6 June 2007

Horizontal Composition Components have the same granularity Client / Server or Peer to Peer

Provided Interfaces / Required Interfaces Low coupling Distributed Application Statecharts Communication by signal JMS, Message-Driven Bean

[email protected] www.fromeo.fr

31

DAIS, Paphos, Cyprus, 6 June 2007

Example : Traffic Light RedLight:Light TrafficLight

YellowLight:Light GreenLight:Light

TrafficLight Start

goRed/ ^RedLight.turnOn

entry: goRed

Red

Light goRed/^RedLight.turnOn, ^YellowLight.turnOff

goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff

Yellow

turnOff

On

Off Off

On

do / display goYellow/^YellowLight.turnOn, ^GreenLight.turnOff

turnOn

Green [email protected] www.fromeo.fr

32

DAIS, Paphos, Cyprus, 6 June 2007

Vertical Composition (De)composition composite/compound Hierarchie (cf. Fractal)

A higher coupling Life-cycle Dependances, encapsulation, …

Theoretical Foundations Revised formalization of aggregation and composition in UML (IEEE TSE 29(5) et 29(11) - 2003) State Machines of compound components integrated into the State Machine of the composite as concurrent macro states : public class Light extends _PauWare.Composable {/* ... */} Light redLight, yellowLight, greenLight; Statechart_monitor trafficLight = new Statechart_monitor(redLight.state_machine() .and(yellowLight.state_machine()) .and(greenLight.state_machine()) .and(start.xor(red).xor(yellow).xor(green)));

[email protected] www.fromeo.fr

33

DAIS, Paphos, Cyprus, 6 June 2007

Example : Traffic Light TrafficLight

TrafficLight Start

goRed/ ^self.RedLight::turnOn

entry: goRed

« delegate »

RedLight:Light « delegate »

Red goRed/^self.RedLight::turnOn, ^self.YellowLight::turnOff

goGreen/ ^self.GreenLight::turnOn, ^self.RedLight::turnOff

Yellow goYellow/^self.YellowLight::turnOn, ^self.GreenLight::turnOff

YellowLight:Light

Green

GreenLight:Light GreenLight:Light

YellowLight:Light

RedLight:Light

« delegate »

[email protected] www.fromeo.fr

34

DAIS, Paphos, Cyprus, 6 June 2007

PauWare Component Model A State Machine Execution Engine (diagrammes UML 2) Model verification at development time Support for implementation Models persist at runtime

State Machine → Components ? Structure-Behavior Binding (i.e. component-statechart) Support for horizontal composition and vertical composition (hierarchical) [email protected] www.fromeo.fr

35

DAIS, Paphos, Cyprus, 6 June 2007

PauWare Component Model « interface » Light functional interface turnOn() turnOff()

Light turnOff

Light « implement »

« class » Light implementation class

On

Off Off

On

do / display turnOn

« service » turnOn() « service » turnOff() « action » display() _Light

1

_Composytor::Statechart_monitor [email protected] www.fromeo.fr

36

DAIS, Paphos, Cyprus, 6 June 2007

Behavior modeled with Statecharts Managed Component SB service2 [guard1] / ^self.serviceX

service1

service2 [guard2] / action1

S11

S10

S12

entry: action1

entry: action0

entry: action2

SA

service2

service2

service1

S2 entry: action3

service2

S3

serviceX / action4

with (guard1 => not guard2) and (guard2 => not guard1)

[email protected] www.fromeo.fr

37

DAIS, Paphos, Cyprus, 6 June 2007

Detailed Architecture «interface» Business Component functional interface service1() service2()

«interface» Internal Pushed Sensor

«interface» External Pushed Sensor

control_service1() control_service2() control_serviceX()

«require»

state_changed(transition)

«interface» Internal Pulled Sensor

«require»

guard1() guard2()

«interface» External Pulled Sensor in(state)

«require»

Business Component «implement»

«class» Business component implementation class «service» service1() «service» service2() «service» serviceX() «action» action0() «action» action1() «action» action2() «action» action3() «action» action4() «guard» guard1() «guard» guard2()

«interface» Internal Effector service1() service2() serviceX() action0() action1() action2() action3() action4()

«require»

Internal Manager «implement»

«interface» External Effector execute(action) to_state(state)

«class» Internal Manager implementation class control_service1() control_service2() control_serviceX() execute(action) to_state(state) in(state)

1

serviceX is not part of the functional interface since it is only sent internally

[email protected] www.fromeo.fr

_Composytor::Statechart_monitor

38

DAIS, Paphos, Cyprus, 6 June 2007

Demo

Management Communication (WMA)

Management Console (JMX)

Wireless Components (J2ME) [email protected] www.fromeo.fr

39

DAIS, Paphos, Cyprus, 6 June 2007

Home automation system Operate

Setup

time-out(1000,null)/ set time(+ 1)

PauWare Library

time-out(1000,null) [no input < 90]/ set no input(no input + 1) temp down [target temperature > Min]/ temp up [target temperature < Max]/ ^self.target temperature changed ^self.target temperature changed

Program refreshing time backward

time forward

Target temperature displaying entry/ display target temperature

Period and program time refreshing entry/ display period and program time

f-c/ switch mode

temp down/ set no input(0)

time-out(1000,null) [alternately 2]/ set alternately(alternately + 1)

f-c

view program

temp up/ set no input(0)

Event

Program target temperature refreshing

State-based programming support

entry/ display program target temperature

Ambient temperature displaying entry/ display ambient temperature

f-c/ switch mode

time-out(1000,null) [alternately = 2]/ set alternately(0)

time backward

time-out(1000,null) [alternately = 2]/ set alternately(0)

time forward

Current date and time refreshing

set clock

entry/ display current date and time

set day

Current date and time displaying

public void f_c() throws Statechart_exception {

entry/ display current date and time

Set program view program [period = 8]/ set period(1)

time-out(1000,null) [alternately 2]/ set alternately(alternately + 1) temp down [target temperature > Min]/ target temperature.decrement

Set period

temp up [target temperature < Max]/ target temperature.increment time backward/ set program time(-15)

run program

_Programmable_thermostat.fires(_Ambient_temperature_displaying,_Ambient_temp erature_displaying);

view program [period 8]/ set period(period + 1)

Run

time forward/ set program time(+15) view program/ set period(1)

Set program time time-out(1000,null) [not weekend]/ set target temperature(1,4)

temp up [programÆat(period).target temperature < Max]/ program->at(period).target temperature.increment

_Programmable_thermostat.fires(_Program_target_temperature_refreshing,_Progra m_target_temperature_refreshing,true,this,"switch_mode");

Set program target temperature time-out(1000,null) [weekend]/ set target temperature(5,8)

temp down [programÆat(period).target temperature > Min]/ program->at(period).target temperature.decrement

hold temp temp down [target temperature > Min]/ target temperature.decrement

Hold

_Programmable_thermostat.fires(_Target_temperature_displaying,_Target_temperat ure_displaying,true,this,"switch_mode");

_Programmable_thermostat.run_to_completion();

Set time

time-out(1000,null) [no input >= 90]

time backward/ set time(-60)

Set current minute

temp up [target temperature < Max]/ target temperature.increment set clock

time backward/ set time(-3600)

}

time forward/ set time(+60) set clock

time forward/ set time(+3600)

Set current hour / ^timer.to be killed

/ ^timer.to be set(1000)

time backward/ set time(-86400)

time forward/ set time(+86400)

Set current day target temperature changed [season switch in Is cool and season switch turned off/ ^air conditioner relay.stop,^furnace relay.stop, ambient temperature > target temperature]/ ^fan relay.stop(fan switch in Is auto),^run indicator.off ^air conditioner relay.run,^fan relay.run,^run indicator.on target temperature changed [season switch in Is cool and ambient temperature.asCelsius < (target temperature.asCelsius – delta)]/ ^air conditioner relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off target temperature changed [season switch in Is heat and ambient temperature < target temperature]/ ^furnace relay.run,^fan relay.run,^run indicator.on target temperature changed [season switch in Is heat and ambient temperature.asCelsius > (target temperature.asCelsius + delta)]/ ^furnace relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off

Control

fan switch turned on/ ^fan relay.run

set day

ambient temperature changed(temperature) [season switch in Is cool and ambient temperature > target temperature]/ ^air conditioner relay.run,^fan relay.run,^run indicator.on

UML-2 run-to-completion model execution mode

ambient temperature changed(temperature) [season switch in Is cool and ambient temperature.asCelsius < (target temperature.asCelsius – delta)]/ ^air conditioner relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off ambient temperature changed(temperature) [season switch in Is heat and ambient temperature < target temperature]/ ^furnace relay.run,^fan relay.run,^run indicator.on ambient temperature changed(temperature) [season switch in Is heat and ambient temperature.asCelsius > (target temperature.asCelsius + delta)]/ ^furnace relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off

[email protected] www.fromeo.fr

40

DAIS, Paphos, Cyprus, 6 June 2007

Home automation system Operate

Setup

time-out(1000,null)/ set time(+ 1)

time-out(1000,null) [no input < 90]/ set no input(no input + 1) temp down [target temperature > Min]/ temp up [target temperature < Max]/ ^self.target temperature changed ^self.target temperature changed

Model Execution

Program refreshing time backward

time forward

Target temperature displaying entry/ display target temperature

Period and program time refreshing entry/ display period and program time

f-c/ switch mode

temp down/ set no input(0)

time-out(1000,null) [alternately 2]/ set alternately(alternately + 1)

f-c

view program

temp up/ set no input(0)

Program target temperature refreshing entry/ display program target temperature

Ambient temperature displaying entry/ display ambient temperature

f-c/ switch mode

time-out(1000,null) [alternately = 2]/ set alternately(0)

time backward

time-out(1000,null) [alternately = 2]/ set alternately(0)

time forward

Current date and time refreshing

set clock

entry/ display current date and time

set day

Current date and time displaying entry/ display current date and time

Set program view program [period = 8]/ set period(1)

time-out(1000,null) [alternately 2]/ set alternately(alternately + 1) temp down [target temperature > Min]/ target temperature.decrement

view program [period 8]/ set period(period + 1)

Set period

temp up [target temperature < Max]/ target temperature.increment time backward/ set program time(-15)

run program

Run

time forward/ set program time(+15) view program/ set period(1)

Set program time time-out(1000,null) [not weekend]/ set target temperature(1,4)

temp up [programÆat(period).target temperature < Max]/ program->at(period).target temperature.increment

Set program target temperature time-out(1000,null) [weekend]/ set target temperature(5,8)

temp down [programÆat(period).target temperature > Min]/ program->at(period).target temperature.decrement

hold temp temp down [target temperature > Min]/ target temperature.decrement

Hold

Set time

time-out(1000,null) [no input >= 90]

time backward/ set time(-60)

time forward/ set time(+60)

Set current minute

temp up [target temperature < Max]/ target temperature.increment set clock

time backward/ set time(-3600)

set clock

time forward/ set time(+3600)

Set current hour / ^timer.to be killed

/ ^timer.to be set(1000)

time backward/ set time(-86400)

time forward/ set time(+86400)

Set current day target temperature changed [season switch in Is cool and season switch turned off/ ^air conditioner relay.stop,^furnace relay.stop, ambient temperature > target temperature]/ ^fan relay.stop(fan switch in Is auto),^run indicator.off ^air conditioner relay.run,^fan relay.run,^run indicator.on target temperature changed [season switch in Is cool and ambient temperature.asCelsius < (target temperature.asCelsius – delta)]/ ^air conditioner relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off target temperature changed [season switch in Is heat and ambient temperature < target temperature]/ ^furnace relay.run,^fan relay.run,^run indicator.on target temperature changed [season switch in Is heat and ambient temperature.asCelsius > (target temperature.asCelsius + delta)]/ ^furnace relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off

Control

fan switch turned on/ ^fan relay.run

set day

ambient temperature changed(temperature) [season switch in Is cool and ambient temperature > target temperature]/ ^air conditioner relay.run,^fan relay.run,^run indicator.on

ambient temperature changed(temperature) [season switch in Is cool and ambient temperature.asCelsius < (target temperature.asCelsius – delta)]/ ^air conditioner relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off ambient temperature changed(temperature) [season switch in Is heat and ambient temperature < target temperature]/ ^furnace relay.run,^fan relay.run,^run indicator.on ambient temperature changed(temperature) [season switch in Is heat and ambient temperature.asCelsius > (target temperature.asCelsius + delta)]/ ^furnace relay.stop,^fan relay.stop(fan switch in Is auto), ^run indicator.off

[email protected] www.fromeo.fr

41

DAIS, Paphos, Cyprus, 6 June 2007

Demo Fan switch Is on auto on/ ^programmable thermostat.fan switch turned on

Is auto

Season switch Is on Is cool heat cool

Is heat

[email protected] www.fromeo.fr

cool

off/ ^programmable thermostat.season switch turned off

Is off

heat

42

DAIS, Paphos, Cyprus, 6 June 2007

Demo : Home Automation System + PauWareView

[email protected] www.fromeo.fr

43

DAIS, Paphos, Cyprus, 6 June 2007

MDA + CBSE MDA (Model-Driven Architecture) Model Centric Developpements Model Transformation UML : structural models and behavioral models

PIM PSM

PSM

CBSE Structural Models : architecture, composition, interfaces… Technological Component Model (model = format) [email protected] www.fromeo.fr

44

PSM

DAIS, Paphos, Cyprus, 6 June 2007

Application Management Monitoring

Management System

Sensors

Controlling Activators

sensors

activators Application

What to monitor? What to control? Where is the line between the application and the management system? [email protected] www.fromeo.fr

45

DAIS, Paphos, Cyprus, 6 June 2007

Towards Autonomic Computing

Cf. Cyril Ballagny’s on-going thesis… [email protected] www.fromeo.fr

46