Introducing BPjs to the IoT class at BGU, Winter 2018 semester.
Includes short BP intro, BPjs overview, and samples for running and verifying b-programs.
2. Agenda
• Behavioral Programming recap
• Introducing BPjs
• Running programs in BPjs
• Embedding BPjs runtime
• Verifying BPjs programs
• Where to go from here
3. Behavioral Programming
• Subtype of scenario-based
programming
• Weaves complex application
behavior from multiple simple ones
• Each simple behavior (b-thread)
describes a scenario
• b-threads synchronize using the
bsync operation, and can request,
block, and wait for b-events.
4. BP Environments
LSC
BP
PlayGo
BP BP
BPjs BPj
AD
LSC
Blockly
Search
ModelChecking
Robocode
IoT
Satellite
LSC
…
ModelChecking
…
BPc
BP-Erl
BP-JS #1
BP-JS #2
BP-Ruby
5. BP Environments
LSC
BP
PlayGo
BP BP
BPjs BPj
AD
LSC
Blockly
Search
ModelChecking
Robocode
IoT
Satellite
LSC
…
ModelChecking
…
BPc
BP-Erl
BP-JS #1
BP-JS #2
BP-Ruby
9. Why is BPjs Different?
BP platform (not paper*)
Allow programmatic access for“lower-level”
BP idioms
E.g. fordevelopingadditionaldiagrammaticformalizations
Create a common platform for BP Research
Allow BP code reuse, not just ideas
Easy joining path for new users
“Gateway drug”to BP
Goal
Aim
* Except for the paper introducing it.
10. How is BPjs Different?
Enable rather than decide (“vendor thinking”)
• Pluggable Event Selection Mechanism,
Event Handlers, and (coming soon) search
strategies
• Embeddable
Robust, dependable software. Modern toolset
geared towards open source and continuous
integration. Plays well with others.
Public code repo, tutorials, transparency
Design
Engineering
Presentation
11. Current Status
• Maven Project
• Free, Open Source (MIT)
• Online documentation
• Embeddable / Commandline
• Continuous CI/QA/Documentation
• GitHub Repo, GitHub Release, Maven Central
• Stable master branch, compiling* develop branch, wild feature
branches
• Seed maven client project available
• Examples in code (tests), Robocode example project.
*mostly
27. House Model
var house = [ " # t " ,
" # # # # # # # " ,
" " ,
" # # # # # # # " ,
" s # " ] ;
28. House Model
var house = [ " # t " ,
" # # # # # # # " ,
" " ,
" # # # # # # # " ,
" s # " ] ;
29. [" # t ",
"## ## ###",
" ",
"### #### ",
" s# "];
Agent B-Threads
in the House
Parsing:
Iterate over characters in house
description string array.
Generate b-threads for each type
of character like so:
30. Agent B-Threads in the House
Spaces
[" # t ",
"## ## ###",
" ",
"### #### ",
" s# "];
31. Agent B-Threads in the House
Start
[" # t ",
"## ## ###",
" ",
"### #### ",
" s# "];
32. Agent B-Threads in the House
Target
[" # t ",
"## ## ###",
" ",
"### #### ",
" s# "];