From: Marcos D. de A. <mar...@gm...> - 2009-10-02 18:57:17
|
> Please how do I schedule the internal event to prevent the resources > from sutting down. > Extend the GridResource class and its body method. In the body you trigger an internal event. The body of your extended resource should look like: public void body() { // schedule an internal event with a the tag INTERNAL_EVENT_TAG super.sim_schedule(super.get_id(), 10.0, INTERNAL_EVENT_TAG); super.body(); } Then, you implement the method processOtherEvent(Sim_event) to handle that internal event and dispatch a new one. The method should look like: protected void processOtherEvent(Sim_event ev) { if (ev.get_tag() == INTERNAL_EVENT_TAG) { // schedule the new internal event with a delay of 10 seconds with a the tag INTERNAL_EVENT_TAG super.sim_schedule(super.get_id(), 10.0, INTERNAL_EVENT_TAG); } else { super.processOtherEvent(ev); } } Regards, Marcos |