| Summary: | [Gen] Code generation fails for Within when no location cell is specified | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] AMP | Reporter: | Miles Parker <milesparker> | ||||||
| Component: | AMF | Assignee: | Miles Parker <milesparker> | ||||||
| Status: | NEW --- | QA Contact: | Miles Parker <milesparker> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | 0.8.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=325659 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 179134 [details]
Failing test case
With seleciton set to "Next Location"
Created attachment 179135 [details]
Workaround test case
Selection set to "Bug rule"
|
See attached model from Rainer Hilscher. 1. Follow tutorial 2. When bug vision selection is created, set selection to "Next Location". (The selected for cell.) 3. Code gen fails with: /** * Bug Rule Rule. Executed every period. */ public void bugRule() { Object nextLocation = (Object) ((org.ascape.model.space.Discrete) getStupidModel() .getGrid2D().getSpace()).findRandomAvailable( ((org.ascape.model.CellOccupant) this).getHostCell(), null, false, nextLocation.getStupidModel().getBugVision()); Workaround is to set selection to Bug Rule. This came about from allowing cells to be unspecified for the case where we are making the assumption that an undefined cell means an empty cell within the (presumably discrete) space. (Not sure that was a good idea for general use, but it makes models significantly simpler to assemble.) But since there is no agent specified for the selection, we need to assume that any references to parent attributes are obtained from the agent itself. For now, we have to specify this manually.