Hello, I'm preparing a simulation, where mobile nodes should express a kind of "surival instinct": Basically, when their energy level reaches a certain level (like, 20% or the original energy at the start of the simulation), they should automatically put themself in sleep mode, or switch off temporarely, in order to give time to their neighbors to recalculate routes that passed through the "dying" node (the simulation uses DSR, so the idea is that the node should to its neighbors look like as if it has gone down, and an RERR shall be generated by them). After a certain timeout (which I still have to figure out how long should it be), the node wakes-up, such that if it's the only intermediate node between two neighbors, communication between them is still possible, albeith the node will probably soon run out of energy because of the forwarding of packets... Is it possible to do this using only Tcl, creating a procedure that auto-schedules itself every 0.1 sec, and checks for every node, if its current energy level has reached a level below the % threshold, and if it has not yet been put to sleep? I know that probably I could implement this by modifying the C++ source code of the DSR agent, or of the MobileNode class, but I'd prefer to keep this into the Tcl space. I saw in the file 'mobilenode.cc', in the method int MobileNode::command(int argc, const char*const* argv) that Tcl mobile nodes support the following commands: 1 - powersaving 2 - off 3 - shutdown What is the difference between these three, and which would be the best suited for my simulation? Also, what does the "setSleepTime" method in the Tcl class MobileNode do? I know that it calls the method with the same name in $netif_(0), but what is its purpose? There is also a method "sleepTime" with the same name in the Tcl class "Simulator"... Thanks a lot
