-
Notifications
You must be signed in to change notification settings - Fork 25
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
Dealing with custom contexts is awkward #131
Comments
Good idea. Maybe you should consider going with |
sigh I suppose you're right. Figured |
@nicolaspayette, if I add these, do you think we could toss |
I'm all for it. And it would have the advantage of eliminating the asymmetry between |
Necroing this. If we want students in MAM to work with nw, it might be worth looking into? Also, I just tweeted about the nw-extension on teh twitter, so I was reminded of the discussion that @nicolaspayette and I had about this a year and a half ago(!). Sorry that I never responded, I thought I did. I would be totally in favor of your proposed suggestions. The fact that IF it's too late to drop nw:get-context, nw:turtles/nw:links/nw:my-links/etc. might still be nice to have. |
Thinking of doing this for hexy. What do you think @arthurhjorth and @nicolaspayette ? Do you think we should also keep @mrerrormessage Can extensions define their own auto-conversion rules? |
I stand by my 2014 comment:
:-) If autoconversion for extension primitives is possible, that would be by far the best option. If not, I think it would be acceptable to outright remove it. I would normally advocate a period of deprecation, but 6.0 seems like a good time to break backward compatibility. The change will need to be clearly documented, though. |
I'm happy to go with whatever you all think is best. I haven't used the The list of auto conversions is here. I'm fine with adding autoconversions for bundled extensions to that list. While a solution that allows extensions to define their own autoconversions is almost certainly possible, due to the way autoconversion is performed, I would expect some pretty colossal difficulty in doing so. Auto Conversion occurs as part of model loading in order to correctly convert all widgets, so information about extensions is pretty minimal. |
I don't know anything about the auto conversion thing, but fixing the error on |
Awesome, thanks for feedback everyone.
This only helps a little with that. You would do |
As long as you stick to breed-set based contexts, the nw primitives mix nicely with the netlogo ones. However, when you switch to static agent-set based contexts, thinks get more difficult. For instance, to the degree of a node, you first have to have a reference to the link-set of the context and then do
count my-links with [ member? self nw-links ]
. This is pretty awkward. One solution would be to provide primitives that mirror the built-in primitives, but relative to the context. For instance:nw:nodes
- turtle-set of the nodes in the networknw:links
- link-set of the links in the networknw:my-links
(and variations thereof) - links connected to callerThe text was updated successfully, but these errors were encountered: