(String id, DTNHost from)
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public Message messageTransferred(String id, DTNHost from) { |
| 60 | Message msg = super.messageTransferred(id, from); |
| 61 | Integer nrofCopies = (Integer)msg.getProperty(MSG_COUNT_PROPERTY); |
| 62 | |
| 63 | assert nrofCopies != null : "Not a SnW message: " + msg; |
| 64 | |
| 65 | if (isBinary) { |
| 66 | /* in binary S'n'W the receiving node gets ceil(n/2) copies */ |
| 67 | nrofCopies = (int)Math.ceil(nrofCopies/2.0); |
| 68 | } |
| 69 | else { |
| 70 | /* in standard S'n'W the receiving node gets only single copy */ |
| 71 | nrofCopies = 1; |
| 72 | } |
| 73 | |
| 74 | msg.updateProperty(MSG_COUNT_PROPERTY, nrofCopies); |
| 75 | return msg; |
| 76 | } |
| 77 | |
| 78 | @Override |
| 79 | public boolean createNewMessage(Message msg) { |
nothing calls this directly
no test coverage detected