bThink-BGU / BPpy

A Python implementation for the Behavioral Programming paradigm
MIT License
8 stars 5 forks source link

add dynamic adding bthreads #2

Closed maor226 closed 1 year ago

maor226 commented 1 year ago

@tomyaacov as mentioned in the email

tomyaacov commented 1 year ago

Hi @maor226 thanks for the PR! This feature is very important and useful. I looked at the update and it looks good. I think it would be useful for me and future users to have an example of how to add bthreads dynamically. Can you upload a file to bppy/examples similar to the examples there? Once we have an example I'll wrap things and release.

maor226 commented 1 year ago

@tomyaacov I added an example, bppy/examples/exponential_growth.py may also close #1

tomyaacov commented 1 year ago

Thanks! However, note that this bprogram does not demonstrate the exponential growth, since all generated bthreads are requesting the same event, and hence all terminate once it is chosen (you can run it and see)