SlideShare a Scribd company logo
DEEP DIVE
INTO
BPJS
BP Group Meeting 2017-07-12
Michael Bar-Sinai
Agenda
• Project Vision, Goal, Other much profound issues
• The Code Repo
• Code
• Packages, Main classes
• Structure at runtime
• Structure at verification?
• Sample Usage
Project Vision
• Create an common infrastructure for BP research
• Allow Code reuse
• Facilitate Research Community
• Be the most boringest part of any

BP research
• cf. ROS, R, NumPy, iPython…
BP
AD
LSC
Search
ModelChecking
Robocode
IoT
Satellite
Event
Selection
StrategyYourResearchHere
BPjs in Research Setting
1. Standalone (just run BPjs code)
• Download BPjs-X.Y.Z.uber.jar from the releases page
• $ java -jar BPjs-X.Y.Z.uber.jar src1.js src2.js …
2. Embedded (used as a decision engine for a larger system)
• Download above jar and add to project classpath, or add as maven dependency,
or fork the sample project on GitHub
3. Post-process
• Pre-processor creates the b-program code and send to BPjs for execution
• Either through embedding the library or through piping code to above jar’s stdin
4. 2 and 3 combined
Vision ☞ Engineering Aims*
• Definition of "done": Coded, unit-tested, documented
• Enable rather than dictate: When a few implementations may
make sense, define an interface and allow users to mix and
match…
• Minimal Setup with reasonable defaults: …and provide an OK
default implementation
• Play well with others: Open source (MIT), Maven, Pure Java
• Look Inviting: Code available online, open CI and code coverage,
have positive internet footprint.
* Not saying we’re there yet
In the Repo
High-level
documentation
Written in Sphinx, published using RTD
In the Repo
All code
Including the unit tests.
In the Repo
Front repo page
In the Repo
Mostly Harmless
Git stuff
CI configuration
Project License
maven thingy
NetBeans thingy
main maven thingy
Branching
• Master: Always stable (“done”).
Normally last version here also
available as a release and in Maven
Central
• Develop: Should always compile and
pass tests (under CI). Small changes go
directly here.
• Feature Branches: For larger changes
that might require breaking builds.
⚠ For developing BPjs itself. NOT for client code that does not require changes to the BPjs core.
Systems and Services
clip art: http://cliparts.co/laptop-pictures-and-images
git
git
git
triggered
triggered
triggered
Manual (release)
triggered
Click system icons visit
them online
Code
(finally)
Packages
• Runtime engine
• (most action here)
• Classes intended as
application starting
points
• Search (verification)
Classes of Note
• BEvent Event in BP. Has name and maybe JS data. Also, a set that contains only itself
• BSyncStatement The runtime representation of the parameters passed to bsync.
Contains request, wait-for, block, and interrupt events. Might also contain metadata.
• BProgram “Classic” b-program in the BP sense. Plus, contains event selection
strategy and a queue of external events. Abstract. Cannot run on its own.
• StringBProgram A BProgram whose source comes from a string
• SingleResourceBProgram A BProgram whose source comes from a .js file
bundled with the code
• EventSelectionStrategy Based on a b-program state, produces set of selectable
events (run and verification), and selects a single event (run only). Interface. BPjs
comes with SimpleEventSelectionStrategy, which uses random event
selection.
More Classes of Note
• BProgramRunner Runs a BProgram, informs listeners.
• BProgramListener BPjs comes with
BProgramListenerAdapter,
InMemoryEventLoggingListener,
StreamLoggerListener
• BThreadSyncSnapshot Captured status of a b-thread when it
called bsync.
• BProgramSyncSnapshot Captured status of a b-program during
a synchronization point. Also contains external event queue.
No BThread Class (!)
• BThreads are emergent phenomenon of progression between
BThreadSyncSnaphots
BTSS BTSS BTSS BTSSStartBThread ResumeBThread ResumeBThread
ResumeBThread
BTSSBTSSBTSS
BTSS
ResumeBThreadResumeBThreadResumeBThread
Resume
Structure at Runtime
Structure during Verification
TBD
How to:
• Instantiate a SingleResourceBProgram with the resource’s name
• Pass that to a BProgramRunner
• Call BProgramRunner#start()
Run a BP program from a resource file
Client
Code
BProgramRunner SingleResourceBProgram
src.js
reads
creates
How to:
• Instantiate a StringBProgram, pass the source to the C’tor
• Pass the StringBProgram to a BProgramRunner
• Call BProgramRunner#start()
Run a BP program from a String
Client
Code
BProgramRunner StringResourceBProgram
- source:String
creates
How to:
• Instantiate a BProgram
• Pass it to a BProgramRunner
• Register a new StreamLoggerListener

(no-args C’tor defaults to stdout)
• Call BProgramRunner#start()
Run a BP program and log events to stdout
Client
Code
BProgramRunner BProgram
creates
EventLoggerListener
- out:OutputStream
How to:
• Instantiate a BProgram
• Pass it to a BProgramRunner
• Register a new StreamLoggerListener

(no-args C’tor defaults to stdout)
• Call BProgramRunner#start()
Run a BP program and log events to stdout
Client
Code
BProgramRunner BProgram
creates
EventLoggerListener
- out:OutputStream
A File
Pass a PrintStream to that file to the C’tor
How to:
• Create a EventStrategySelection decorator
that performs the needed inspections
• Instantiate a BProgram, pass it to

a BProgramRunner
• Set the BProgram’s ESS to a

decorated instance
• BProgramRunner#run
• e.g. LoggingEventSelectionStrategyDecorator
Inspect a BProgram's state at Sync point
Client
Code
BProgramRunner BProgram
creates
EventSelectionStrategy
InspectorESS
reports
How to:
• Before execution starts:

Put values in the program’s global scope.
• During Execution:

Enqueue external events.
Pass data TO a BProgram
How to:
• Read from its global scope

getFromGlobalScope(name, class)
• Listen to events using a
BProgramEventListener
Get data FROM a BProgram
Sample Usage
How Bad is 

Random Event Selection
1)
Create
a Fair
ESS
Extend
SimpleEvent
SelectionStr
ategy
2) Write a Simple Program
3)
Collect
Wait
Times
Using a
BProgramListener.

Note use of the
adapter variant
QUESTIONS?
DEEP DIVE INTO BPJS
Thanks

More Related Content

What's hot

Containerized build
Containerized buildContainerized build
Containerized build
Daniel Foo
 
Bdd Net Frameworks
Bdd Net FrameworksBdd Net Frameworks
Bdd Net Frameworks
hdgarcia
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CI
CEE-SEC(R)
 
Test stack
Test stackTest stack
Test stack
Radim Daniel PĂĄnek
 
Super Charged Configuration As Code
Super Charged Configuration As CodeSuper Charged Configuration As Code
Super Charged Configuration As Code
Alan Beale
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
daisuke awaji
 
Google App Engine - Java Style
Google App Engine - Java StyleGoogle App Engine - Java Style
Google App Engine - Java Style
Peter Lind
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and React
Grgur Grisogono
 
Code review vs pull request
Code review vs pull requestCode review vs pull request
Code review vs pull request
Bryan Liu
 
OpenAPI development with Python
OpenAPI development with PythonOpenAPI development with Python
OpenAPI development with Python
Takuro Wada
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
Bert Jan Schrijver
 
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Jonas Hecht
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007
Tim Bunce
 
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL PluginJUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
CloudBees
 
Oleksandr Yefremov Continuously delivering mobile project
Oleksandr Yefremov Continuously delivering mobile projectOleksandr Yefremov Continuously delivering mobile project
Oleksandr Yefremov Continuously delivering mobile project
Аліна Шепшелей
 
Rails初心者レッスン lesson1
Rails初心者レッスン lesson1Rails初心者レッスン lesson1
Rails初心者レッスン lesson1
Satomi Tsujita
 
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
Juraj MichĂĄlek
 
.ASP NET CORE ON DOCKER
.ASP NET CORE ON DOCKER.ASP NET CORE ON DOCKER
.ASP NET CORE ON DOCKER
JosĂŠ Barbosa
 
Cutting the Kubernetes Monorepo in pieces – never learnt more about git
Cutting the Kubernetes Monorepo in pieces – never learnt more about gitCutting the Kubernetes Monorepo in pieces – never learnt more about git
Cutting the Kubernetes Monorepo in pieces – never learnt more about git
Stefan Schimanski
 
用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手
Shengyou Fan
 

What's hot (20)

Containerized build
Containerized buildContainerized build
Containerized build
 
Bdd Net Frameworks
Bdd Net FrameworksBdd Net Frameworks
Bdd Net Frameworks
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CI
 
Test stack
Test stackTest stack
Test stack
 
Super Charged Configuration As Code
Super Charged Configuration As CodeSuper Charged Configuration As Code
Super Charged Configuration As Code
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Google App Engine - Java Style
Google App Engine - Java StyleGoogle App Engine - Java Style
Google App Engine - Java Style
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and React
 
Code review vs pull request
Code review vs pull requestCode review vs pull request
Code review vs pull request
 
OpenAPI development with Python
OpenAPI development with PythonOpenAPI development with Python
OpenAPI development with Python
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
 
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007
 
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL PluginJUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
 
Oleksandr Yefremov Continuously delivering mobile project
Oleksandr Yefremov Continuously delivering mobile projectOleksandr Yefremov Continuously delivering mobile project
Oleksandr Yefremov Continuously delivering mobile project
 
Rails初心者レッスン lesson1
Rails初心者レッスン lesson1Rails初心者レッスン lesson1
Rails初心者レッスン lesson1
 
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
AĹĽ se z kĂłdu neprĂĄĹĄĂ­! 2013
 
.ASP NET CORE ON DOCKER
.ASP NET CORE ON DOCKER.ASP NET CORE ON DOCKER
.ASP NET CORE ON DOCKER
 
Cutting the Kubernetes Monorepo in pieces – never learnt more about git
Cutting the Kubernetes Monorepo in pieces – never learnt more about gitCutting the Kubernetes Monorepo in pieces – never learnt more about git
Cutting the Kubernetes Monorepo in pieces – never learnt more about git
 
用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手
 

Similar to Deep Dive into BPjs

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
Ignasi GonzĂĄlez
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Pantheon
 
JDK Tools For Performance Diagnostics
JDK Tools For Performance DiagnosticsJDK Tools For Performance Diagnostics
JDK Tools For Performance Diagnostics
Baruch Sadogursky
 
Spring insight what just happened
Spring insight   what just happenedSpring insight   what just happened
Spring insight what just happened
Boulder Java User's Group
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
lenamattt
 
Session 2
Session 2Session 2
Session 2gayathiry
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away
Abhishek Bakshi
 
Enter Cookbook: refactoring under a microscope
Enter Cookbook: refactoring under a microscopeEnter Cookbook: refactoring under a microscope
Enter Cookbook: refactoring under a microscope
Kamil Samigullin
 
Effective C++
Effective C++Effective C++
Effective C++
Andrey Karpov
 
PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)
Andrey Karpov
 
Develop Maintainable Apps - edUiConf
Develop Maintainable Apps - edUiConfDevelop Maintainable Apps - edUiConf
Develop Maintainable Apps - edUiConf
Annyce Davis
 
[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV
Deep Learning JP
 
PostgreSQL Performance Problems: Monitoring and Alerting
PostgreSQL Performance Problems: Monitoring and AlertingPostgreSQL Performance Problems: Monitoring and Alerting
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Zivtech, LLC
 
Building Your First App with Shawn Mcarthy
Building Your First App with Shawn Mcarthy Building Your First App with Shawn Mcarthy
Building Your First App with Shawn Mcarthy
MongoDB
 
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Aysylu Greenberg
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Mark Proctor
 
How to help your editor love your vue component library
How to help your editor love your vue component libraryHow to help your editor love your vue component library
How to help your editor love your vue component library
Piotr Tomiak
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 

Similar to Deep Dive into BPjs (20)

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
JDK Tools For Performance Diagnostics
JDK Tools For Performance DiagnosticsJDK Tools For Performance Diagnostics
JDK Tools For Performance Diagnostics
 
Spring insight what just happened
Spring insight   what just happenedSpring insight   what just happened
Spring insight what just happened
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away
 
Enter Cookbook: refactoring under a microscope
Enter Cookbook: refactoring under a microscopeEnter Cookbook: refactoring under a microscope
Enter Cookbook: refactoring under a microscope
 
Effective C++
Effective C++Effective C++
Effective C++
 
PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)
 
Develop Maintainable Apps - edUiConf
Develop Maintainable Apps - edUiConfDevelop Maintainable Apps - edUiConf
Develop Maintainable Apps - edUiConf
 
[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV
 
PostgreSQL Performance Problems: Monitoring and Alerting
PostgreSQL Performance Problems: Monitoring and AlertingPostgreSQL Performance Problems: Monitoring and Alerting
PostgreSQL Performance Problems: Monitoring and Alerting
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
 
Building Your First App with Shawn Mcarthy
Building Your First App with Shawn Mcarthy Building Your First App with Shawn Mcarthy
Building Your First App with Shawn Mcarthy
 
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
How to help your editor love your vue component library
How to help your editor love your vue component libraryHow to help your editor love your vue component library
How to help your editor love your vue component library
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 

Recently uploaded

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 

Recently uploaded (20)

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 

Deep Dive into BPjs

  • 1. DEEP DIVE INTO BPJS BP Group Meeting 2017-07-12 Michael Bar-Sinai
  • 2. Agenda • Project Vision, Goal, Other much profound issues • The Code Repo • Code • Packages, Main classes • Structure at runtime • Structure at verification? • Sample Usage
  • 3. Project Vision • Create an common infrastructure for BP research • Allow Code reuse • Facilitate Research Community • Be the most boringest part of any
 BP research • cf. ROS, R, NumPy, iPython… BP AD LSC Search ModelChecking Robocode IoT Satellite Event Selection StrategyYourResearchHere
  • 4. BPjs in Research Setting 1. Standalone (just run BPjs code) • Download BPjs-X.Y.Z.uber.jar from the releases page • $ java -jar BPjs-X.Y.Z.uber.jar src1.js src2.js … 2. Embedded (used as a decision engine for a larger system) • Download above jar and add to project classpath, or add as maven dependency, or fork the sample project on GitHub 3. Post-process • Pre-processor creates the b-program code and send to BPjs for execution • Either through embedding the library or through piping code to above jar’s stdin 4. 2 and 3 combined
  • 5. Vision ☞ Engineering Aims* • Definition of "done": Coded, unit-tested, documented • Enable rather than dictate: When a few implementations may make sense, define an interface and allow users to mix and match… • Minimal Setup with reasonable defaults: …and provide an OK default implementation • Play well with others: Open source (MIT), Maven, Pure Java • Look Inviting: Code available online, open CI and code coverage, have positive internet footprint. * Not saying we’re there yet
  • 6. In the Repo High-level documentation Written in Sphinx, published using RTD
  • 7. In the Repo All code Including the unit tests.
  • 8. In the Repo Front repo page
  • 9. In the Repo Mostly Harmless Git stuff CI configuration Project License maven thingy NetBeans thingy main maven thingy
  • 10. Branching • Master: Always stable (“done”). Normally last version here also available as a release and in Maven Central • Develop: Should always compile and pass tests (under CI). Small changes go directly here. • Feature Branches: For larger changes that might require breaking builds. ⚠ For developing BPjs itself. NOT for client code that does not require changes to the BPjs core.
  • 11. Systems and Services clip art: http://cliparts.co/laptop-pictures-and-images git git git triggered triggered triggered Manual (release) triggered Click system icons visit them online
  • 13. Packages • Runtime engine • (most action here) • Classes intended as application starting points • Search (verification)
  • 14. Classes of Note • BEvent Event in BP. Has name and maybe JS data. Also, a set that contains only itself • BSyncStatement The runtime representation of the parameters passed to bsync. Contains request, wait-for, block, and interrupt events. Might also contain metadata. • BProgram “Classic” b-program in the BP sense. Plus, contains event selection strategy and a queue of external events. Abstract. Cannot run on its own. • StringBProgram A BProgram whose source comes from a string • SingleResourceBProgram A BProgram whose source comes from a .js file bundled with the code • EventSelectionStrategy Based on a b-program state, produces set of selectable events (run and verification), and selects a single event (run only). Interface. BPjs comes with SimpleEventSelectionStrategy, which uses random event selection.
  • 15. More Classes of Note • BProgramRunner Runs a BProgram, informs listeners. • BProgramListener BPjs comes with BProgramListenerAdapter, InMemoryEventLoggingListener, StreamLoggerListener • BThreadSyncSnapshot Captured status of a b-thread when it called bsync. • BProgramSyncSnapshot Captured status of a b-program during a synchronization point. Also contains external event queue.
  • 16. No BThread Class (!) • BThreads are emergent phenomenon of progression between BThreadSyncSnaphots BTSS BTSS BTSS BTSSStartBThread ResumeBThread ResumeBThread ResumeBThread BTSSBTSSBTSS BTSS ResumeBThreadResumeBThreadResumeBThread Resume
  • 19. How to: • Instantiate a SingleResourceBProgram with the resource’s name • Pass that to a BProgramRunner • Call BProgramRunner#start() Run a BP program from a resource file Client Code BProgramRunner SingleResourceBProgram src.js reads creates
  • 20. How to: • Instantiate a StringBProgram, pass the source to the C’tor • Pass the StringBProgram to a BProgramRunner • Call BProgramRunner#start() Run a BP program from a String Client Code BProgramRunner StringResourceBProgram - source:String creates
  • 21. How to: • Instantiate a BProgram • Pass it to a BProgramRunner • Register a new StreamLoggerListener
 (no-args C’tor defaults to stdout) • Call BProgramRunner#start() Run a BP program and log events to stdout Client Code BProgramRunner BProgram creates EventLoggerListener - out:OutputStream
  • 22. How to: • Instantiate a BProgram • Pass it to a BProgramRunner • Register a new StreamLoggerListener
 (no-args C’tor defaults to stdout) • Call BProgramRunner#start() Run a BP program and log events to stdout Client Code BProgramRunner BProgram creates EventLoggerListener - out:OutputStream A File Pass a PrintStream to that file to the C’tor
  • 23. How to: • Create a EventStrategySelection decorator that performs the needed inspections • Instantiate a BProgram, pass it to
 a BProgramRunner • Set the BProgram’s ESS to a
 decorated instance • BProgramRunner#run • e.g. LoggingEventSelectionStrategyDecorator Inspect a BProgram's state at Sync point Client Code BProgramRunner BProgram creates EventSelectionStrategy InspectorESS reports
  • 24. How to: • Before execution starts:
 Put values in the program’s global scope. • During Execution:
 Enqueue external events. Pass data TO a BProgram
  • 25. How to: • Read from its global scope
 getFromGlobalScope(name, class) • Listen to events using a BProgramEventListener Get data FROM a BProgram
  • 26. Sample Usage How Bad is 
 Random Event Selection
  • 28. 2) Write a Simple Program
  • 30.
  • 32. DEEP DIVE INTO BPJS Thanks