|
From: Peter H.M. J. <p.h...@tb...> - 2004-10-14 06:33:57
|
Dear Dirk and others,
I have looked at your code. I think you are on the right track! Keep it
going...
If you update your project from cvs you will see that I made quite some
comments.. All the comments start with TODO Peter. This will help you sort
out what I did (The TODO's give a blue mark in your Java editor).
I would highly encourage others to download the project and to look at the
comments I made ("SPM9322 -port" project on CVS).
Dirk, mail me what you think and when I can update the new code (there is
still stuff to do for you...)
Peter
-----Original Message-----
From: dso...@li...
[mailto:dso...@li...] On Behalf Of Dirk Samson
Sent: Wednesday, October 13, 2004 3:11 PM
To: dso...@li...
Subject: [Dsol-java] how to listen to fireEvent?
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")
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Dsol-java mailing list
Dso...@li...
https://lists.sourceforge.net/lists/listinfo/dsol-java
|