Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325628 - [Gen] Code generation fails for Within when no location cell is specified
Summary: [Gen] Code generation fails for Within when no location cell is specified
Status: NEW
Alias: None
Product: AMP
Classification: Modeling
Component: AMF (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact: Miles Parker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 12:46 EDT by Miles Parker CLA
Modified: 2010-09-17 17:41 EDT (History)
0 users

See Also:


Attachments
Failing test case (8.35 KB, application/octet-stream)
2010-09-17 12:51 EDT, Miles Parker CLA
no flags Details
Workaround test case (8.34 KB, application/octet-stream)
2010-09-17 12:52 EDT, Miles Parker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Parker CLA 2010-09-17 12:46:43 EDT
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.
Comment 1 Miles Parker CLA 2010-09-17 12:51:30 EDT
Created attachment 179134 [details]
Failing test case

With seleciton set to "Next Location"
Comment 2 Miles Parker CLA 2010-09-17 12:52:20 EDT
Created attachment 179135 [details]
Workaround test case

Selection set to "Bug rule"