Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fleck.jl example #110

Closed
sdwfrost opened this issue Dec 13, 2023 · 9 comments
Closed

Add Fleck.jl example #110

sdwfrost opened this issue Dec 13, 2023 · 9 comments

Comments

@sdwfrost
Copy link
Contributor

Modify this example from @slwu89

@slwu89
Copy link
Contributor

slwu89 commented Dec 14, 2023

Nice! I think I may have an idea about how to use Fleck.jl to implement an operad algebra style of composition to build models by gluing Poisson processes together, i.e. the long running issue here AlgebraicJulia/AlgebraicDynamics.jl#38

But I'll need to wait for break when I'll have a chance to think about it in more detail.

Also the vector addition system wrapper for the samplers in Fleck was quite barebones and really just a proof of concept. Happy to hear any suggestions on how to improve it. I guess interoperability with AlgPetri would be a start.

@sdwfrost
Copy link
Contributor Author

I've been playing with your example @slwu89 - I had to change the name of sampler to smplr due to a name clash in Distributions.jl. I also couldn't access many of the samplers you put (including those in comments). As this is an exponential sampler, smplr = DirectCall{Int}() worked, as did CombinedNextReaction.

I also tried to extend to the Gamma(4,1) scenario for recovery rates (as in this example), but although it ran, it wasn't giving the right result.

@sdwfrost
Copy link
Contributor Author

@slwu89 - how's this?

@slwu89
Copy link
Contributor

slwu89 commented Dec 15, 2023

@sdwfrost the Gamma(4,1) not working is strange and disturbing...I'll check that out.

@slwu89
Copy link
Contributor

slwu89 commented Mar 1, 2024

@sdwfrost so I forgot that the VAS was not set up to handle non-exponential distributions. The package itself works perfectly fine for any type of distribution at all, but the VAS wasn't. The issue is that the VAS assumes that each event only needs a single clock (because all events have identical rate and the hazards are simply summed). To do a Gamma(4,1) for recovery times would need to send a new clock key to the sampler each time that transition was enabled.

I'm happy to expand the example to include some actual non-Markovian dynamics (including Dirac delays) but I am once again having some compatibility problems with the various packages in the Project.toml file in the repo. How did you get Fleck to install and precompile? It needs a more recent version of Distributions than the version that Julia's package manager is able to install for me, given the various constraints between packages in the repo (see below).

(sir-julia) pkg> st Distributions
Status `~/Desktop/git/sir-julia/Project.toml`
⌅ [31c24e10] Distributions v0.23.8
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`

@sdwfrost
Copy link
Contributor Author

sdwfrost commented Mar 1, 2024

I need to get rid of that repo-wide Project.toml; after a certain number of examples, it just becomes too difficult to maintain compatibility. I just use an example-specific env for tricky examples (Pkg.activate/instantiate).

@slwu89
Copy link
Contributor

slwu89 commented Mar 2, 2024

I think this is good to close with #111. @sdwfrost note that I didn't regenerate the notebooks, etc because I'm not sure how the folder specific Project.toml will interact with root dir Project.toml.

@sdwfrost
Copy link
Contributor Author

sdwfrost commented Mar 7, 2024

Thanks @slwu89! Closing as suggested. Still lots more to go...

@sdwfrost sdwfrost closed this as completed Mar 7, 2024
@slwu89
Copy link
Contributor

slwu89 commented Mar 7, 2024

Hah, of course. Hopefully I will revisit the Fleck example in the future after we develop some exciting new features (already have common random numbers worked in it; working on other helpful tools for calibration).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants