SlideShare a Scribd company logo
Towards an Integration of the Actor
Model in an FRP Language for
Small-Scale Embedded Systems
Takuo Watanabe & Kensuke Sawada
Department of Computer Science, Tokyo Institute of Technology
Oct. 30, 2016
AGERE!@SPLASH 2016
1
About This Work
• An actor-based execution model of a pure FRP
languages for small-scale embedded systems
• Objective
- flexible execution models
- open/customizable interface with higher-level abstraction
• Talk Outline
- EmFRP
- Runtime System
- Actor-Based Runtime Implementation
- Future Work
2
"Small-Scale" Embedded Systems
• Resource-Constrained Systems
- Processor: 8–32bit
- Clock: ≤ 100MHz
- Program Storage: ≤ 1M words
- RAM: ≤ 1M bytes
- No MMU
• w/o full-fledged OS (e.g., Linux)
- embedded in special purpose devices
• ex) Microcontrollers
- PIC, AVR, H8, ARM Cortex-M, etc.
3
Emfrp [Sawada & Watanabe, CROW2016]
• An FRP language for small-scale embedded systems
- Strongly-typed, Purely functional
• parametric polymorphism & type inference
• algebraic data types & pattern matching
- Simple abstraction for time-varying values (aka signals)
• node: named, non-first-class representation
• lifting-free
- Bounded & predictable amount of runtime memory
• syntactic restrictions & type system
• github.com/sawaken/emfrp
- Compiler & Interpreter (written in Ruby)
• The compiler generates platform-independent ANSI-C code
runnable several microcontrollers (AVR, ARM Cortex-M)
4
Ex1: Air-Conditioner Controller in Emfrp
5
01: module ACController # module name
02: in tmp : Float, # temperature sensor
03: hmd : Float # humidity sensor
04: out ac : Bool # air-conditioner
05: use Std # standard library
06:
07: # discomfort (temperature-humidity) index
08: node di = 0.81 * tmp + 0.01 * hmd
09: * (0.99 * tmp - 14.3) + 46.3
10:
11: # air-conditioner status
12: node init[False] ac = di >= 75.0 + ho
13:
14: # hysteresis offset
15: node ho = if ac@last then -0.5 else 0.5
History-Sensitive Behavior with @last
6
# air-conditioner status
node ac = di >= 75.0
# air-conditioner status
node init[False] ac =
di >= 75.0 + ho
# hysteresis offset
node ho = if ac@last
then -0.5 else 0.5
75.0
di
ac
75.0
di
ac
Emfrp syntax for referring to the previous value of an
arbitrary node (cf. foldp in Elm)
Case Study: Digital Clock [CROW2016]
• Target: mbed LPC1768
- ARM Cortex M3, 96MHz
- RAM 32K, Flash 512K
- LCD, 3 Buttons
• Code
- Emfrp: 80 loc
- Glue code in C++: 45 loc
- External Libraries
• Compiled Code
- Generated C code: 592 loc
- Binary (ARM RVDS4.1)
• w/o library : 2.3 KB
• w/ library: 30.1 KB
7
Related Work
8
Yampa
(FRP)
Elm
(FRP)
Céu
(procedural)
Simulink
(dataflow)
CFRP*
(FRP)
Emfrp
(FRP)
Usable for Small-Scale
Embedded Systems ✕ ✕ ⃝ ⃝ ⃝ ⃝
Frist-Class Functions ⃝ ⃝ ⃝ ✕ ⃝ ✕
Algebraic Data Types
& Pattern Matching ⃝ ⃝ ✕ ✕ ✕ ⃝
Declarative Programming
& Referential Transparency ⃝ ⃝ ✕ △ ⃝ ⃝
Automated Unit Test ⃝ ⃝ ✕ ⃝ ✕ ⃝
Modularity & Abstractness ⃝ ⃝ △ ⃝ ⃝ ⃝
*Another FRP language developed by use in prior to Emfrp
DAG Representation of Ex1
9
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
ho
(Float)
temperature
sensor
humidity
sensor
discomfort index
air-
conditioner
air-conditioner
status
hysteresis offset
node dependency
past-value dependencynode
device connection
Push-Based Execution Model of Emfrp
10
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
ho
(Float)
tmp hmd di ho ac
iteration
The runtime system
updates the values of the
nodes by repeatedly
evaluating them in an order
compatible to the DAG.
module ACController # module name
in tmp : Float, # temperature sensor
hmd : Float # humidity sensor
pulse10ms : Bool # hardware interval timer (10ms)
out ac : Bool, # air-conditioner
led : Bool # LED
use Std # standard library
# discomfort (temperature-humidity) index
node di = 0.81 * tmp + 0.01 * hmd * (0.99 * tmp - 14.3) + 46.3
# timer counter (resets to 0 every 1 minute)
node init[0] timer =
if !pulse10ms@last && pulse10ms
then (timer@last + 1) % 6000 else timer@last
# air-conditioner switch
node ac = if timer@last != timer && timer == 0
then di >= 75.0 else ac@last
# LED blinks at 1Hz
node led = (timer % 100) < 50
Ex2: A Timer-Based Air-Conditioner Controller
11
Actor-Based Execution Model
• With the push-based execution model, tmp, hmd and di
are evaluated in every iteration. However, the value of
them required only once per minute.
• In this work, we adopt an actor representation of
nodes to provide flexible runtime strategies and good
abstractions runtime access
- one actor (implemented as a C++ object) per node
- message-based dependency propagation
• single dispatch queue model
• transmission order preservation (a la ABCL)
- customizable scheduling via reflection (GWR)
• GWR = Reflection on Actor-Groups [Watanabe, AGERE2013]
12
DAG Representation of Ex2
13
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
timer
(Int)
temperature
sensor
humidity
sensor
air-
conditioner
led
(Bool)
hardware
timer
pulse
10ms
(Bool)
LED
class TMPNode : public Actor {
public:
TMPNode(Actor2 *di, TMPSensor *tmp);
virtual ~TMPNode() {}
virtual void activate(Message *m);
private:
Actor2 *di;
TMPSensor *tmp;
}
void TMPNode::activate(Message *m) {
di->send1(Message::floatMessage(tmp->read(), m->cust));
}
class DINode : public Actor2 {
public:
DINode(Actor *ac) ac(ac) { ... }
virtual ~DINode() {}
virtual void activate(Message *m);
private:
Actor *ac;
}
void DINode::activate(Message *mt, Message *mh) {
assert(mt->cust == mh->cust);
float t = mt->getFloat(), h = mh->getFloat();
float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3;
ac->send(Message::floatMessage(di, mt->cust));
}
Actor-Based
Representation of
Nodes in Ex2
14
Ex: Delayed (Lazy/Pull) Blocks
• An expression suffixed with @delay indicates that the
expression is evaluated only when it is required.
• Nodes in a delayed block and their dependent nodes
are evaluated in a separate actor group that is
activated only when it is needed.
15
# air-conditioner switch
node ac = if timer@last != timer && timer == 0
then (di >= 75.0)@delay else ac@last
The Actor-Group for the Delayed Block
• Actors in the group
for the delayed block
is detached from the
main iteration path.
- They have separate
message queue.
• The detached actor
group is activated by
sending an activation
message from ac
when they are
needed.
16
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
timer
(Int)
led
(Bool)
pulse
10ms
(Bool)
class DINode : public Actor2 { ... }
void DINode::activate(Message *mt, Message *mh) {
float t = mt->getFloat(), h = mh->getFloat();
float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3;
mt->cust->send(mkFloatMessage(di, mt->cust));
}
class ACNode : public Actor { ... }
void ACNode::activate(Message *m) {
if (m->prevInt() != m->getInt() &&
m->getInt() == 0) {
acDelayedBlockGroup->send(Message::unitMessage(&acDelayedBlock));
}
}
class ACDelayedBlock : public Actor { ...}
void ACDelayedBlock::activate(Message *m) {
m->cust->send(
Message::booleanMessage(m->getFloat() > 75.0, m->cust));
}
17
Summary & Future Work
• Proposed an actor-based execution model of Emfrp.
- actor representation of nodes (time-varying values)
- GWR for flexible execution strategies
• Future Work
- Possible Applications
• Asynchronous (Future) Node
- heavy node / slow peripheral devices / inter-device communication
• Group-Wide Iteration Control
- periodical iteration / deep sleep mode / interrupts from devices
• Actors as signal values
- Relationship to other concurrent / event models
- Better (meta-level) interface
- Implementation
18

More Related Content

PDF
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
PPTX
Intro to OpenMP
PPT
OpenMP And C++
PDF
Open mp library functions and environment variables
PDF
OpenMP Tutorial for Beginners
PPT
A synchronous scheduling service for distributed real-time Java
PPT
Programming using Open Mp
PPTX
Parallelization using open mp
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
Intro to OpenMP
OpenMP And C++
Open mp library functions and environment variables
OpenMP Tutorial for Beginners
A synchronous scheduling service for distributed real-time Java
Programming using Open Mp
Parallelization using open mp

What's hot (20)

PPTX
MPI n OpenMP
PPT
Semaphores and Monitors
PDF
Introduction to OpenMP
PPT
Enhancing the region model of RTSJ
PDF
Concurrent Programming OpenMP @ Distributed System Discussion
ODP
openmp
PPTX
Semophores and it's types
PPTX
Semaphore
PDF
Open mp intro_01
KEY
OpenMP
PDF
Introduction to OpenMP (Performance)
PPT
No Heap Remote Objects for Distributed real-time Java
PDF
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
PPTX
Presentation on Shared Memory Parallel Programming
DOCX
Lab3 advanced port scanning 30 oct 21
PPT
Mutual exclusion and sync
PDF
Open mp directives
PDF
Jvm profiling under the hood
DOCX
Module-related pages
PPT
Simple asynchronous remote invocations for distributed real-time Java
MPI n OpenMP
Semaphores and Monitors
Introduction to OpenMP
Enhancing the region model of RTSJ
Concurrent Programming OpenMP @ Distributed System Discussion
openmp
Semophores and it's types
Semaphore
Open mp intro_01
OpenMP
Introduction to OpenMP (Performance)
No Heap Remote Objects for Distributed real-time Java
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
Presentation on Shared Memory Parallel Programming
Lab3 advanced port scanning 30 oct 21
Mutual exclusion and sync
Open mp directives
Jvm profiling under the hood
Module-related pages
Simple asynchronous remote invocations for distributed real-time Java
Ad

Viewers also liked (20)

PDF
A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
PDF
A Reflective Implementation of an Actor-based Concurrent Context-Oriented System
PDF
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
PDF
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
PDF
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
PDF
Incremental Feature Location and Identification in Source Code
PDF
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
PDF
Refactoring Edit History of Source Code
PDF
Feature Location for Multi-Layer System Based on Formal Concept Analysis
PDF
Guiding Identification of Missing Scenarios for Dynamic Feature Location
PDF
Detecting Occurrences of Refactoring with Heuristic Search
PDF
Terminology Matching of Requirements Specification Documents and Regulations ...
PDF
Toward Understanding How Developers Recognize Features in Source Code from De...
PDF
Understanding Source Code Differences by Separating Refactoring Effects
PDF
iFL: An Interactive Environment for Understanding Feature Implementations
PDF
Toward Structured Location of Features
PDF
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
PDF
Sentence-to-Code Traceability Recovery with Domain Ontologies
PDF
Visualizing Stakeholder Concerns with Anchored Map
PDF
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Implementation of an Actor-based Concurrent Context-Oriented System
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
Incremental Feature Location and Identification in Source Code
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Refactoring Edit History of Source Code
Feature Location for Multi-Layer System Based on Formal Concept Analysis
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Detecting Occurrences of Refactoring with Heuristic Search
Terminology Matching of Requirements Specification Documents and Regulations ...
Toward Understanding How Developers Recognize Features in Source Code from De...
Understanding Source Code Differences by Separating Refactoring Effects
iFL: An Interactive Environment for Understanding Feature Implementations
Toward Structured Location of Features
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Sentence-to-Code Traceability Recovery with Domain Ontologies
Visualizing Stakeholder Concerns with Anchored Map
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
Ad

Similar to Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems (20)

PPTX
Threads and multi threading
PPT
Data race
PDF
04 performance
PPT
Hs java open_party
PPTX
Onnc intro
PPTX
ADSP processor Notes by Pritish Vibhute.pptx
PPTX
Design & Analysis of Algorithm course .pptx
PPTX
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
PPT
OpenMP-Quinn17_L4bOpen <MP_Open MP_Open MP
PPTX
Week1 Electronic System-level ESL Design and SystemC Begin
PPTX
Jvm memory model
PDF
Pretzel: optimized Machine Learning framework for low-latency and high throug...
PPT
Lecture1
DOCX
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
PDF
Simple, fast, and scalable torch7 tutorial
PPT
Parallelization of Coupled Cluster Code with OpenMP
PDF
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
PPTX
JVM Memory Model - Yoav Abrahami, Wix
PDF
Pretzel: optimized Machine Learning framework for low-latency and high throug...
PDF
Porting a Streaming Pipeline from Scala to Rust
Threads and multi threading
Data race
04 performance
Hs java open_party
Onnc intro
ADSP processor Notes by Pritish Vibhute.pptx
Design & Analysis of Algorithm course .pptx
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
OpenMP-Quinn17_L4bOpen <MP_Open MP_Open MP
Week1 Electronic System-level ESL Design and SystemC Begin
Jvm memory model
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Lecture1
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
Simple, fast, and scalable torch7 tutorial
Parallelization of Coupled Cluster Code with OpenMP
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
JVM Memory Model - Yoav Abrahami, Wix
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Porting a Streaming Pipeline from Scala to Rust

Recently uploaded (20)

PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPT
Introduction Database Management System for Course Database
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Introduction to Artificial Intelligence
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administration Chapter 2
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
history of c programming in notes for students .pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Introduction Database Management System for Course Database
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms II-SECS-1021-03
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction to Artificial Intelligence
Digital Strategies for Manufacturing Companies
System and Network Administration Chapter 2
VVF-Customer-Presentation2025-Ver1.9.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Computer Software and OS of computer science of grade 11.pptx
CHAPTER 2 - PM Management and IT Context
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
history of c programming in notes for students .pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf

Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems

  • 1. Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems Takuo Watanabe & Kensuke Sawada Department of Computer Science, Tokyo Institute of Technology Oct. 30, 2016 AGERE!@SPLASH 2016 1
  • 2. About This Work • An actor-based execution model of a pure FRP languages for small-scale embedded systems • Objective - flexible execution models - open/customizable interface with higher-level abstraction • Talk Outline - EmFRP - Runtime System - Actor-Based Runtime Implementation - Future Work 2
  • 3. "Small-Scale" Embedded Systems • Resource-Constrained Systems - Processor: 8–32bit - Clock: ≤ 100MHz - Program Storage: ≤ 1M words - RAM: ≤ 1M bytes - No MMU • w/o full-fledged OS (e.g., Linux) - embedded in special purpose devices • ex) Microcontrollers - PIC, AVR, H8, ARM Cortex-M, etc. 3
  • 4. Emfrp [Sawada & Watanabe, CROW2016] • An FRP language for small-scale embedded systems - Strongly-typed, Purely functional • parametric polymorphism & type inference • algebraic data types & pattern matching - Simple abstraction for time-varying values (aka signals) • node: named, non-first-class representation • lifting-free - Bounded & predictable amount of runtime memory • syntactic restrictions & type system • github.com/sawaken/emfrp - Compiler & Interpreter (written in Ruby) • The compiler generates platform-independent ANSI-C code runnable several microcontrollers (AVR, ARM Cortex-M) 4
  • 5. Ex1: Air-Conditioner Controller in Emfrp 5 01: module ACController # module name 02: in tmp : Float, # temperature sensor 03: hmd : Float # humidity sensor 04: out ac : Bool # air-conditioner 05: use Std # standard library 06: 07: # discomfort (temperature-humidity) index 08: node di = 0.81 * tmp + 0.01 * hmd 09: * (0.99 * tmp - 14.3) + 46.3 10: 11: # air-conditioner status 12: node init[False] ac = di >= 75.0 + ho 13: 14: # hysteresis offset 15: node ho = if ac@last then -0.5 else 0.5
  • 6. History-Sensitive Behavior with @last 6 # air-conditioner status node ac = di >= 75.0 # air-conditioner status node init[False] ac = di >= 75.0 + ho # hysteresis offset node ho = if ac@last then -0.5 else 0.5 75.0 di ac 75.0 di ac Emfrp syntax for referring to the previous value of an arbitrary node (cf. foldp in Elm)
  • 7. Case Study: Digital Clock [CROW2016] • Target: mbed LPC1768 - ARM Cortex M3, 96MHz - RAM 32K, Flash 512K - LCD, 3 Buttons • Code - Emfrp: 80 loc - Glue code in C++: 45 loc - External Libraries • Compiled Code - Generated C code: 592 loc - Binary (ARM RVDS4.1) • w/o library : 2.3 KB • w/ library: 30.1 KB 7
  • 8. Related Work 8 Yampa (FRP) Elm (FRP) Céu (procedural) Simulink (dataflow) CFRP* (FRP) Emfrp (FRP) Usable for Small-Scale Embedded Systems ✕ ✕ ⃝ ⃝ ⃝ ⃝ Frist-Class Functions ⃝ ⃝ ⃝ ✕ ⃝ ✕ Algebraic Data Types & Pattern Matching ⃝ ⃝ ✕ ✕ ✕ ⃝ Declarative Programming & Referential Transparency ⃝ ⃝ ✕ △ ⃝ ⃝ Automated Unit Test ⃝ ⃝ ✕ ⃝ ✕ ⃝ Modularity & Abstractness ⃝ ⃝ △ ⃝ ⃝ ⃝ *Another FRP language developed by use in prior to Emfrp
  • 9. DAG Representation of Ex1 9 tmp (Float) hmd (Float) di (Float) ac (Bool) ho (Float) temperature sensor humidity sensor discomfort index air- conditioner air-conditioner status hysteresis offset node dependency past-value dependencynode device connection
  • 10. Push-Based Execution Model of Emfrp 10 tmp (Float) hmd (Float) di (Float) ac (Bool) ho (Float) tmp hmd di ho ac iteration The runtime system updates the values of the nodes by repeatedly evaluating them in an order compatible to the DAG.
  • 11. module ACController # module name in tmp : Float, # temperature sensor hmd : Float # humidity sensor pulse10ms : Bool # hardware interval timer (10ms) out ac : Bool, # air-conditioner led : Bool # LED use Std # standard library # discomfort (temperature-humidity) index node di = 0.81 * tmp + 0.01 * hmd * (0.99 * tmp - 14.3) + 46.3 # timer counter (resets to 0 every 1 minute) node init[0] timer = if !pulse10ms@last && pulse10ms then (timer@last + 1) % 6000 else timer@last # air-conditioner switch node ac = if timer@last != timer && timer == 0 then di >= 75.0 else ac@last # LED blinks at 1Hz node led = (timer % 100) < 50 Ex2: A Timer-Based Air-Conditioner Controller 11
  • 12. Actor-Based Execution Model • With the push-based execution model, tmp, hmd and di are evaluated in every iteration. However, the value of them required only once per minute. • In this work, we adopt an actor representation of nodes to provide flexible runtime strategies and good abstractions runtime access - one actor (implemented as a C++ object) per node - message-based dependency propagation • single dispatch queue model • transmission order preservation (a la ABCL) - customizable scheduling via reflection (GWR) • GWR = Reflection on Actor-Groups [Watanabe, AGERE2013] 12
  • 13. DAG Representation of Ex2 13 tmp (Float) hmd (Float) di (Float) ac (Bool) timer (Int) temperature sensor humidity sensor air- conditioner led (Bool) hardware timer pulse 10ms (Bool) LED
  • 14. class TMPNode : public Actor { public: TMPNode(Actor2 *di, TMPSensor *tmp); virtual ~TMPNode() {} virtual void activate(Message *m); private: Actor2 *di; TMPSensor *tmp; } void TMPNode::activate(Message *m) { di->send1(Message::floatMessage(tmp->read(), m->cust)); } class DINode : public Actor2 { public: DINode(Actor *ac) ac(ac) { ... } virtual ~DINode() {} virtual void activate(Message *m); private: Actor *ac; } void DINode::activate(Message *mt, Message *mh) { assert(mt->cust == mh->cust); float t = mt->getFloat(), h = mh->getFloat(); float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3; ac->send(Message::floatMessage(di, mt->cust)); } Actor-Based Representation of Nodes in Ex2 14
  • 15. Ex: Delayed (Lazy/Pull) Blocks • An expression suffixed with @delay indicates that the expression is evaluated only when it is required. • Nodes in a delayed block and their dependent nodes are evaluated in a separate actor group that is activated only when it is needed. 15 # air-conditioner switch node ac = if timer@last != timer && timer == 0 then (di >= 75.0)@delay else ac@last
  • 16. The Actor-Group for the Delayed Block • Actors in the group for the delayed block is detached from the main iteration path. - They have separate message queue. • The detached actor group is activated by sending an activation message from ac when they are needed. 16 tmp (Float) hmd (Float) di (Float) ac (Bool) timer (Int) led (Bool) pulse 10ms (Bool)
  • 17. class DINode : public Actor2 { ... } void DINode::activate(Message *mt, Message *mh) { float t = mt->getFloat(), h = mh->getFloat(); float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3; mt->cust->send(mkFloatMessage(di, mt->cust)); } class ACNode : public Actor { ... } void ACNode::activate(Message *m) { if (m->prevInt() != m->getInt() && m->getInt() == 0) { acDelayedBlockGroup->send(Message::unitMessage(&acDelayedBlock)); } } class ACDelayedBlock : public Actor { ...} void ACDelayedBlock::activate(Message *m) { m->cust->send( Message::booleanMessage(m->getFloat() > 75.0, m->cust)); } 17
  • 18. Summary & Future Work • Proposed an actor-based execution model of Emfrp. - actor representation of nodes (time-varying values) - GWR for flexible execution strategies • Future Work - Possible Applications • Asynchronous (Future) Node - heavy node / slow peripheral devices / inter-device communication • Group-Wide Iteration Control - periodical iteration / deep sleep mode / interrupts from devices • Actors as signal values - Relationship to other concurrent / event models - Better (meta-level) interface - Implementation 18