[Avrora] Stop simulation from Monitor/Watch

Alban Hessler alban.mailing at googlemail.com
Thu May 14 06:44:13 PDT 2009


Hi,

I would like that avrora stops after that certain conditions are met
by my WSN program. However, I cannot find in the API how I can do that
properly, without breaking the Avrora structure. here is a snippet of
the code:

public class StopWhenMyAppFinishes extends Simulator.Watch.Empty {
	static int counter =0;
    int base;
    int max;
    String log;

    public  StopWhenMyAppFinishes(int b, int m) {
        base = b;
        max = m;
    }

    public void fireBeforeWrite(State state, int data_addr, byte value) {
      // play with static counter
      // If conditions are met, stop the simulation:
      // Try to stop the simulation here..
}

}


>From the state instance, I can only access methods that are specific
to the node, and not to the entire simulation. What would be the right
approach/call?

Best regards and thank you,

Alban


More information about the Avrora mailing list