| Summary: | Repast Generation - MetaABM translates Context to Agent in model.score | ||
|---|---|---|---|
| Product: | [Modeling] AMP | Reporter: | befloibent |
| Component: | AMF | Assignee: | Miles Parker <milesparker> |
| Status: | CLOSED FIXED | QA Contact: | Miles Parker <milesparker> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 0.8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
befloibent
Hi Manuel, Thanks for the bug report. To be honest, there hasn't been a ton of interest in Repast generation -- though I spent a lot of time developing it at the beginning it turns out that a lot of people want to simply generate straight to the AMP platform -- so this hasn't been an area that has been kept current as well as it could be. However, if there *are* users who want to see good support and are willing to file bug reports ;) this will most definitely get attention. On area that is lacking is good multi-scale support. I'll get the Model.score translation working as quickly as possible. One thing that would be extremely helpful is when people see code patterns that don't work -- like you've just described -- they could provide a code snippet that shows what is currently generated and one that shows what would ideally be generated. That makes the fixes that need to happen super-straight-forward. cheers, Miles Thanks Miles. I'm also just getting started with Repast, so you might very well have a better idea of what should be getting generated than I, but in the implementation of ContextBuilder for my root context BugTestRootContext, this is being generated:
BugTestSubContext createBugTestSubContexts = null;
for (int i = 0; i < getBugTestSubContextCount(); i++) {
createBugTestSubContexts = new BugTestSubContext();
context.add(createBugTestSubContexts); //<-Adds like Agent
createBugTestSubContexts.setBugTestRootContext(this); //<-Error
}
I believe what should be generated is:
BugTestSubContext createBugTestSubContexts = null;
for (int i = 0; i < getBugTestSubContextCount(); i++) {
createBugTestSubContexts = new BugTestSubContext();
context.addSubContext(createBugTestSubContexts); //<-Add as SubContext
}
In the generated model.score file, I'm seeing:
<agents label="BugTest SubContext" ID="bugTestSubContext" pluralLabel="BugTest SubContexts">
where I believe it should be
<agents xsi:type="score:SContext"label="BugTest SubContext" ID="bugTestSubContext" pluralLabel="BugTest SubContexts">
(Hopefully Bugzilla didn't mangle the angle brackets).
The reason I'm targeting Repast is the understanding (correct or not) that 3D Geography (not just 2.5D) is not implemented with Ascape/Escape. I'd be happy to learn otherwise. I'm modeling aspects of bird movement where height is a critical component.
Thanks,
-Manuel
(In reply to comment #2) > Thanks Miles. I'm also just getting started with Repast, so you might very > well have a better idea of what should be getting generated than I, but in the > implementation of ContextBuilder for my root context BugTestRootContext, this > is being generated: > > BugTestSubContext createBugTestSubContexts = null; > for (int i = 0; i < getBugTestSubContextCount(); i++) { > createBugTestSubContexts = new BugTestSubContext(); > context.add(createBugTestSubContexts); //<-Adds like Agent > createBugTestSubContexts.setBugTestRootContext(this); //<-Error > } > > I believe what should be generated is: > > BugTestSubContext createBugTestSubContexts = null; > for (int i = 0; i < getBugTestSubContextCount(); i++) { > createBugTestSubContexts = new BugTestSubContext(); > context.addSubContext(createBugTestSubContexts); //<-Add as SubContext > } Perfect. I'm not sure that that is all that is needed to get subcontexts to work properly but it should at least be a good start. > In the generated model.score file, I'm seeing: > > <agents label="BugTest SubContext" ID="bugTestSubContext" pluralLabel="BugTest > SubContexts"> > > where I believe it should be > > <agents xsi:type="score:SContext"label="BugTest SubContext" > ID="bugTestSubContext" pluralLabel="BugTest SubContexts"> Yes, that sounds exactly right. > (Hopefully Bugzilla didn't mangle the angle brackets). > > The reason I'm targeting Repast is the understanding (correct or not) that 3D > Geography (not just 2.5D) is not implemented with Ascape/Escape. I'd be happy > to learn otherwise. I'm modeling aspects of bird movement where height is a > critical component. You're correct, it's not yet. Though "it wouldn't be that hard". :) Seriously, what's needed is some pretty straightforward code for the actual 3D geometry (simple distance functions) along with a few changes to the visualization to support 3D locations for shapes. It would also be really nice to have model level support for headings / vectors. But I agree that unless you want to get into framework issues and contribute to the actual AMP code base that it probably makes sense to start with Repast. Of course, you'll be able to target Escape as well if you chose to do that later when full 3D support is working. (BTW, feel free to open a feature request for that -- I don't think one exists yet but its definitely on my mental todo list.) That changes are easy, but unfortunately, the only hold up right now is that the Eclipse automated build system is broken -- I've been spending all of my available time for the last few weeks trying to get a better solution up and running. That's close to being finished. Hi Manuel, Apologies for taking so long to get this in -- the problem was not the changes at all but getting the build working. :( As the build promotion is still not up you'll need to use the build server update site at: https://build.eclipse.org/hudson/view/Athena%20CBI/job/cbi-amp-nightly/lastSuccessfulBuild/artifact/amp.p2.repository/ if you want to test it now. Please let me know if the fix works.. I'm going to close this as AMP will not be updated for future versions of Repast unless demand for that functionality exists. |