Skip to content

tomyaacov/BPpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*** This Repository is Deprecated ***

Check the updated repository: https://github.com/bThink-BGU/BPpy

BPpy: Behavioral Programming In Python

Install

You can install bppy with:

git clone https://github.com/tomyaacov/BPpy.git
cd BPpy
pip install -e .

Run

from bppy import *


def add_hot():
    yield {request: BEvent("HOT")}
    yield {request: BEvent("HOT")}
    yield {request: BEvent("HOT")}


def add_cold():
    yield {request: BEvent("COLD")}
    yield {request: BEvent("COLD")}
    yield {request: BEvent("COLD")}


def control_temp():
    while True:
        yield {waitFor: BEvent("COLD"), block: BEvent("HOT")}
        yield {waitFor: BEvent("HOT"), block: BEvent("COLD")}

   
if __name__ == "__main__":
    b_program = BProgram(source_name="hot_cold_bath",
                         # bthreads=[add_hot(), add_cold(), control_temp()], # alternative to source name
                         event_selection_strategy=SimpleEventSelectionStrategy(),
                         listener=PrintBProgramRunnerListener())
    b_program.run()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages