I was working through the tutorials. I was stumped on this for the Actions Part II tutorial (eclipse.org/amp/documentation/contents/Tutorials.html#Actions_Part_II).
When I did (as best I understood to do) the steps described in the tutorial I was receiving a compiler error in the generated code:
/**
* <!-- begin-user-doc -->
* Bug Rule Rule. Executed every period.
* <!-- end-user-doc -->
* @generated
*/
public void bugRule() {
Object nextLocation = (Object) ((org.ascape.model.space.Discrete) getStupidModel1()
.getGrid2D().getSpace()).findRandomAvailable(
((org.ascape.model.CellOccupant) this).getHostCell(), null,
false, nextLocation.getStupidModel1().getBugVision());
if (nextLocation != null) {
if (getHostScape() != ((Agent) nextLocation).getScape()) {
die();
getStupidModel1().getBugScape().add(this);
}
moveTo(((HostCell) nextLocation));
}
}
The error being caught was "The method getSimpleModel1 is undefined for the type Object"
Simply modifying the nextLocation.getSimpleModel1().getBugVision()
to getSimpleModel1().getBugVision()
fixed the problem, and I was able to then run the model.
I am just wanting to point out this error in the generated code. Is anyone else experiencing this problem? I tried to look around this forum, but there were no results on a search. Google yielded nothing as well.
Thanks,
Mathew Grabau