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

#20 - Add assignment as getter function of reset map #22

Merged
merged 2 commits into from
Feb 8, 2019
Merged

Conversation

mforets
Copy link
Collaborator

@mforets mforets commented Feb 7, 2019

Closes #20.

@mforets mforets changed the title #20 - Add assignment as getter function for reset map #20 - Add assignment as getter function of reset map Feb 7, 2019

Returns the assignment for the transition `t`.
"""
assignment(hs::HybridSystem, t) = hs.resetmaps[symbol(hs, t)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard could use assignment in his implementation

@codecov
Copy link

codecov bot commented Feb 7, 2019

Codecov Report

Merging #22 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   81.13%   81.25%   +0.11%     
==========================================
  Files           6        6              
  Lines         159      160       +1     
==========================================
+ Hits          129      130       +1     
  Misses         30       30
Impacted Files Coverage Δ
src/HybridSystems.jl 71.42% <100%> (+2.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2d1a9f...a4d11da. Read the comment docs.

@blegat blegat merged commit 59f8eb8 into master Feb 8, 2019
@schillic schillic deleted the mforets/20 branch February 8, 2019 15:44
@schillic
Copy link
Collaborator

schillic commented Feb 8, 2019

I find this implementation misleading. In the standard terminology, the assignment is the part of the transition that is applied after taking the transition. In this package, resetmaps wraps both the (usual) assignment and the guard.

@blegat
Copy link
Owner

blegat commented Feb 8, 2019

That's a good point, what do you suggest ?

@mforets
Copy link
Collaborator Author

mforets commented Feb 8, 2019

I see what you mean; but the "problem" is that the maps are types, not functions. (we could otherwise let assignment return the apply function ... ).

Consider here page 9 (which refers to Henzinger's), it calls it "jump relation" Jump(e) as (guard, assignment) tuples for each edge.

@schillic
Copy link
Collaborator

schillic commented Feb 8, 2019

Yes, I would change the name. "Jump relation" could also be misunderstood as the transition relation. resetmap would be in the terminology of this package.

@mforets
Copy link
Collaborator Author

mforets commented Feb 8, 2019

Just that? To let resetmap(hs, t) = hs.resetmaps[symbol(hs, t)] ? And then we can do apply(resetmap(hs, t), X)

And how about assignment(hs, t) = x -> apply(hs.resetmaps[symbol(hs, t)], x...)?

@mforets mforets mentioned this pull request Feb 9, 2019
@schillic
Copy link
Collaborator

schillic commented Feb 9, 2019

Hm, thinking about this, I kind of disagree again. guard is a getter, while assignment is proposed to apply the assignment. How about apply_assignment instead?

@mforets
Copy link
Collaborator Author

mforets commented Feb 9, 2019

assignment doesn't apply the assignment; it returns the function. So i understand it also as a getter. It is different from assignment(hs, t, args).

@schillic
Copy link
Collaborator

schillic commented Feb 9, 2019

You wrote assignment(hs, t) = x -> apply(hs.resetmaps[symbol(hs, t)], x...) above.
Are you saying that apply does not apply? 🙀

EDIT: I see now that you mean the change in #25. Then I agree again.

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.

3 participants