Re: more vehicle problems.

jon klein <[email protected]> Tue, 19 Apr 2005 11:03:49 -0400
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
On Apr 19, 2005, at 7:31 AM, Cavan Fyans wrote:

> i am still having varous problems with the vehicles. I am running 2
> vehicles with no lights or anything (i have taken everything else out
> of the code) to test the vehicle motion as when the simulation runs
> they jup about over the screen, jitter and other things, where they
> are supposed to just slowly move about...?

It looks like the problem is with your use of the class 
"BraitenbergControl".
The "Controller" is a special object which manages the simulation, and 
there
should be only one instance of it in the entire simulation.
"BraitenbergControl" is a subclass of "Control".

In a Braitenberg vehicles simulation, your control class should be a 
subclass
of "BraitenbergControl", but you should not create additional instances 
of it.
In your current simulation, there are 3 controller objects!  There's one
instance of "main", and two classes of "BraitenbergControl".

Your code:

	Control : main {
		+ to init:
			one = new myBraitenbergControl.
			two = new myBraitenbergControl.
	}

	BraitenbergControl : myBraitenbergControl {
			...
	}

That code creates one class of "main", and two of 
"myBraitenbergControl", all
of which are trying to control the simulation and ultimately causing 
unexpected
behaviors.  Here's that code modified to create only one controller, 
"main":

	BraitenbergControl : main {
		+ to init:
			one = new myBraitenbergVehicle.
			two = new myBraitenbergVehicle.
	}

	Object : myBraitenbergVehicle {
			...
	}

Hope that helps!

- jon

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve