Changelog: Following are changes made to extend SWANS with (1) multiple interface support (2) collecting statistics on radio modes (for calculation of wasted energy) *********************************** **** multiple interface support: ** *********************************** * Added field Field.mapPrimaryRadioToSecondary to Field class which maps between primary and secondary radios. Used in multi-radio support to move all radios when the primary radio moves. Primary radio is the one on which Field.startMobility() method is invoked. (Field.java) * Added method Field.addRadio(...) that accepts, in addition to other parameters, also id of the primary radio. This method should be invoked when a secondary radio is added to the field. (Field.java) * Changed method Field.moveRadio(...) to move secondary radios when the primary one is moved on the field (Field.java) * Changed method Field.delRadio(...) to remove mapping to secondary radios when the primary radio is removed (the secondary radios are not removed from the field) (Field.java) * Added field RadioInfoShared.name to indicate the name of the radio (BT, WiFi, etc.). It is used to resolve the interference issue -- the interference occurs only for radios sharing the same name (see below). (RadioInfo.java) * Added method RadioInfoShared.getName() to retrieve the name of the radio (RadioInfo.java) * Added method RadioInfo.createShared(...) that accepts also the name of the radio (RadioInfo.java) * Changed method Field.transmitVisitor.new SpatialTransmitVisitor() {...}.computeSignal(...) to prevent interference (and locking on a signal) between two radios with different names (Field.java) ****************************** **** collecting statistics: ** ****************************** * Added class jist.swans.radio.RadioModeStats for collecting statistics on times a radio remains in each of its modes (sleep / idle / transmit / receive / sense), and calculating wasted energy. * Added method RadioNoise.setStats(...) that accepts RadioModeStats as a parameter (RadioNoise.java) * Changed method RadioNoise.setMode(...) that notifies statistics collector on the change of radio mode (if such collector was set for the radio) (RadioNoise.java) * Added field RadioInfo.stats to hold statistics collector (RadioInfo.java) * Added method RadioInfo.getStats() to retrieve statistics (RadioInfo.java) * Added method Field.RadioData.getStats() to retrieve statistics (Field.java) Note: access radio statistics collector from Field instance by radio id as: field.getRadioData(id).getStats()