Community
Participate
Working Groups
Rules defined in the main Scape will not be executed at all. The MetaABM editor does not show any errors or warnings when adding rules to the Actions of the main Scape. Code generation will mostly be done. But no rule will be added since that would be done by the parent scape. In this case, there is no parent scape. I guess, adding a Rule to the main Scape does not make much sense. In that case, I'd expect a warning from the editor telling me not to add Rules to the main Scape. Steps to reproduce: 1. Create a MetaABM file and open it in the MetaABM Editor. 2. Open the Actions node. 3. Create a Rule member on the Actions node. 4. Add any behaviour to the new Rule. 5. Execute the model and see that our Rule will not be executed (or consult the generated Java code to find missing Rule registration).
Yes, I think that we need to handle this case -- interestingly it rarely comes up for ABM models because we don't typically don't have arbitrary behavior at the top level -- but it will obviously be important for other kinds of models. This is the case because rules are actually executed by the containing scape and if that doesn't exist.. The pattern we use for accomplishing this in plain old Ascape is to create a singleton scape as a proxy, add it to the top-level context and use it to manage that parent context's behavior. Note BTW, that build actions *are* added. Jonas, feel free to bump the priority if this is important behavior for you.
For me, this is not a high level bug. It's just confusing if you're not aware of this fact. Why don't agents run rules on their own?
(In reply to comment #2) > For me, this is not a high level bug. It's just confusing if you're not aware > of this fact. > > Why don't agents run rules on their own? Hi Jonas, This is actually a big part of the overall Ascape design. See http://www.brookings.edu/es/dynamics/models/ascape/20000301_ascape.pdf page 11 for original justification. To be clear, I don't have any hardcore philosophically bent against agents doing their own thing, ;) but then we have to come up with a rationale for it. The issue isn't really that agents shouldn't be able to run rules on their own, but that there needs to be some mechanism or spatial-temporal context for that to occur in. From a wider perspective in some sense you could say that this is somewhat analogous (or elided with) the issue of containment. The top-level container for a model is not a model, it's the file/artifact itself. That top-level temporal concern isn't the model, it's user/computational time! In the Ascape design, it is the top-level scape (context) that defines that. But I think it does make sense for the top-level scape to be able to execute behaviors on itself at least. Now, aren't you sorry you asked? For the Acore design my plan has been to separate out the temporal from the spatial/topological/hierarchical concerns, so that might clear up these distinctions.
Committed to git. Please try it out.