|
From: Dirk S. <di...@tb...> - 2004-10-13 13:11:42
|
Dear all,
I've made a "crane" that delivers "containers" every 1..5 timeunits. These
containers should be picked up by several "someVehicles". I would like to
have my crane fire an event, CONTAINER_RELEASED_EVENT. The code for this I
found in the tutorial, section 4.2:
...
public class QuayCrane extends EventProducer {
public static final EventType CONTAINER_RELEASED_EVENT = new EventType(
"CONTAINER_RELEASED_EVENT");
...
private void releaseContainer () {
...
this.fireEvent(CONTAINER_RELEASED_EVENT, this.simulator.getSimulatorTime());
... }
} // end class
My question:
How do I get an instance of my someVehicle to listen to this event? The
events in the tutorial are (so it seems) only used by the Tallies. For this
moment I;m not interested in the prioritization of my someVehicles; I just
want them to respond.
Is this the proper mechanism to create interaction between objects in the
simulation??
Dirk Samson
(PS My very-first-test-project can be found on the CVS Server: "SPM9322 -
port")
|