Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325850 - [Escape Gen] Rules in main Scape are not being executed
Summary: [Escape Gen] Rules in main Scape are not being executed
Status: RESOLVED FIXED
Alias: None
Product: AMP
Classification: Modeling
Component: AMF (show other bugs)
Version: 0.8.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact: Miles Parker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-21 09:41 EDT by Jonas Ruttimann CLA
Modified: 2011-01-14 22:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Ruttimann CLA 2010-09-21 09:41:27 EDT
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).
Comment 1 Miles Parker CLA 2010-09-21 13:01:45 EDT
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.
Comment 2 Jonas Ruttimann CLA 2010-09-22 01:59:09 EDT
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?
Comment 3 Miles Parker CLA 2010-09-22 13:22:38 EDT
(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.
Comment 4 Miles Parker CLA 2011-01-14 22:31:29 EST
Committed to git. Please try it out.