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 continuous events to DSL #763

Closed
wants to merge 75 commits into from
Closed

Add continuous events to DSL #763

wants to merge 75 commits into from

Conversation

TorkelE
Copy link
Member

@TorkelE TorkelE commented Jan 14, 2024

Adds the ability to create continuous events in the DSL. Uses a general event PR that discrete events can also use. tests currently cover both continuous and discrete events (for when the latter gets added, it was easier to do them both at once). Documentation not added. We can do that later, or post-merging (DSL docs need revamping anyway).

Expected syntax is used. Events are encapsulated by a @continuous_events option block. Within it, they are written as normal equations are declared. Example:

    # Creates model via DSL.
    rn_dsl = @reaction_network rn begin
        @parameters thres=1.0
        @variables Z(t)
        @continuous_events begin
            [t - 2.5] => [p ~ p + 0.2]
            [X - thres, Y - X] => [X ~ X - 0.5, Z ~ Z + 0.1]
        end

        (p, dX), 0 <--> X
        (p, dY), 0 <--> Y
    end

@TorkelE
Copy link
Member Author

TorkelE commented Jan 14, 2024

This PR is based on #736, and should be merged after that one.

@isaacsas isaacsas mentioned this pull request Feb 28, 2024
47 tasks
@TorkelE
Copy link
Member Author

TorkelE commented Apr 8, 2024

Git history not sustainable anymore, reuploaded as #801

@TorkelE TorkelE closed this Apr 8, 2024
@TorkelE TorkelE deleted the add_continious_events branch June 8, 2024 18:28
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

Successfully merging this pull request may close these issues.

1 participant