Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » AMP » Tutorials Problem with Actions Part 2
Tutorials Problem with Actions Part 2 [message #784208] Fri, 27 January 2012 02:43
Mathew Grabau is currently offline Mathew Grabau
Messages: 1
Registered: January 2012
Junior Member
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
Previous Topic:Cannot see graph view
Next Topic:Importing external jars for custom code.
Goto Forum:
  


Current Time: Fri Aug 01 22:35:26 EDT 2014

Powered by FUDForum. Page generated in 0.01762 seconds