Bug 307310 - Generated Escape code not compilable- wrong arguments to findRandomAvailableNeighbor()
Summary: Generated Escape code not compilable- wrong arguments to findRandomAvailableN...
Status: RESOLVED FIXED
Alias: None
Product: AMP (ARCHIVED)
Classification: Modeling
Component: AMF (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact: Miles Parker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-28 14:07 EDT by John T. Murphy CLA
Modified: 2010-03-30 19:04 EDT (History)
0 users

See Also:


Attachments
The metaabm file that produces the error (67.06 KB, text/plain)
2010-03-28 14:09 EDT, John T. Murphy CLA
no flags Details
Java file with error as generated on my system (9.31 KB, application/octet-stream)
2010-03-28 14:10 EDT, John T. Murphy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John T. Murphy CLA 2010-03-28 14:07:47 EDT
Build Identifier: M20100211-1343

The source code generated by this metaABM file is incorrect. The function 'findRandomAvailableNeighbor() is called with improper arguments. The conditional construction may be incorrect as well.

Reproducible: Always

Steps to Reproduce:
1. Import the attached metaABM file into a new Escape project
2. Clean and build the project
3. Inspect the 'Second Movement' act of the Individual agent.
Comment 1 John T. Murphy CLA 2010-03-28 14:09:42 EDT
Created attachment 163187 [details]
The metaabm file that produces the error

File was renamed from '.metaabm' to '.txt' for upload; should be renamed for testing.
Comment 2 John T. Murphy CLA 2010-03-28 14:10:43 EDT
Created attachment 163188 [details]
Java file with error as generated on my system
Comment 3 Miles Parker CLA 2010-03-29 22:33:23 EDT
OK, here's the issue with the design:

For selection, you have individual. This should be "location" (for rather obscure reasons, btw, in the demo model that will need to change to Place for the next update of AMF). That's because you're moving to a location, not an individual. It doesn't make sense to move to an individual, because they cannot be occupied.

So this is a case not where the generation is wrong, but that it should never have been allowed to happen in the first place, because the model is wrong. Instead, the user should have been notified of a model design error. The solution I think is to add a check for such a movement. Here we would check to ensure that the location being moved to is actually the fill agent for the space in question.

However, I'm not absolutely certain that that is the right course, as there may be cases where it would make sense to allow this.
Comment 4 Miles Parker CLA 2010-03-30 19:04:22 EDT
Added logic for testing this mis-specification.