Utility message chooser
Merge request reports
Activity
added 2 commits
added 8 commits
-
7117059b...de2a3c64 - 3 commits from branch
master
- 99ad6aad - Finish up UtilityMessageChooserTest
- 4029c275 - Merge remote-tracking branch 'remotes/origin/master' into feature-#354-utility-message-chooser
- fad7da25 - Fix failing test
- 14f9db35 - Fix replications density
- ff87a411 - Remove unnecessary import
Toggle commit list-
7117059b...de2a3c64 - 3 commits from branch
added 1 commit
- af16421d - Add message chooser tests to DisasterRouterTest
added Needs Review label
removed Needs Review label
added 21 commits
-
42250986...9395f7a3 - 20 commits from branch
master
- d650803c - Merge remote-tracking branch 'remotes/origin/master' into feature-#354-utility-message-chooser
-
42250986...9395f7a3 - 20 commits from branch
added Needs Review label
SonarQube analysis reported 4 issues
-
🔽 1 minor -
ℹ 3 info
-
207 public Collection<Tuple<Message, Connection>> findOtherMessages( 208 Collection<Message> messages, List<Connection> connections) { 209 Collection<Tuple<Message, Connection>> chosenMessages = new ArrayList<>(); 210 211 // Add ordinary messages. 212 for (Connection con : connections) { 213 DTNHost neighbor = con.getOtherNode(this.attachedHost); 214 for (Message m : messages) { 215 if (!m.isFinalRecipient(neighbor) && this.shouldBeSent(m, neighbor)) { 216 chosenMessages.add(new Tuple<>(m, con)); 217 } 218 } 219 } 220 221 // Wrap useful data stored at host in data messages to neighbors and add them to the messages to sent. 222 chosenMessages.addAll(DatabaseApplicationUtil.createDataMessages( Maybe "select" or "choose". And instead of "other" you could be more specific (e.g. non-direct).
Also in the simulator data messages are not chosen but generated, so they might even be moved out of the Choosing strategy. Adding it to the collection of messages to be sent could simply be done in the DisasterRouter after getting the result of the choosing strategy.
We adopted the name with "other" from other routing protocols already implemented in the ONE. So leaving it as it is is more consistent, but confusing. :/ I guess I'll just change it.
As finding the data includes a choosing, I think the data messages are correct in the message chooser.
612 613 // Prepare message with medium replications density. 614 Message popularMessage = new Message(h1, h6, "M1", 0); 615 h1.createNewMessage(popularMessage); 616 h0.createNewMessage(popularMessage); 617 h1.connect(h0); 618 h1.connect(h5); 619 this.clock.advance(DisasterRouterTestUtils.RD_WINDOW_LENGTH); 620 disconnect(h1); 621 this.updateAllNodes(); 622 623 // Check that we only send to the neighbor with high encounter value AND high power. 624 this.mc.reset(); 625 h1.connect(h2); 626 this.updateAllNodes(); 627 Assert.assertFalse("Should not send to social neighbor with low power value.", this.mc.next()); Why don't you create release branches for the versions to be simulated? Then the version with the UtilityChooser can already go into master and you have a clearly specified version you use for the simulation. This would also be helpful when going back later for further simulation runs of a configuration/routing version
added Needs Changes label
removed Needs Changes label
SonarQube analysis reported 4 issues
-
🔽 1 minor -
ℹ 3 info
-
- src/test/UtilityMessageChooserTest.java 0 → 100644
519 } 520 521 /** 522 * Checks the provided message-connection tuple list for the existence of a tuple mapping a message with the 523 * provided ID to a connection where the host which is not {@link #attachedHost} is the provided host. 524 * 525 * @param messages List to check. 526 * @param id Message ID to look for. 527 * @param host Host to look for. 528 * @return True if such a message can be found. 529 */ 530 private boolean messageToHostsExists(Collection<Tuple<Message, Connection>> messages, String id, DTNHost host) { 531 boolean messageFound = false; 532 for (Tuple<Message, Connection> tuple : messages) { 533 if (tuple.getKey().getId().equals(id) && tuple.getValue().getOtherNode(this.attachedHost).equals(host)) { 534 messageFound = true; removed Needs Review label
added Needs Review label
SonarQube analysis reported 4 issues
-
🔽 1 minor -
ℹ 3 info
-
added Needs wiki documentation label
SonarQube analysis reported 4 issues
-
🔽 1 minor -
ℹ 3 info
-
15 15 ReplicationsDensity.windowLength = 120 16 16 17 17 # Parameters for message choosing 18 # ! TODO: Uncommented this once message choosing is implemented ! 19 # UtilityMessageChooser.dpWeight = 0.95 20 # UtilityMessageChooser.powerWeight = 0.05 21 # UtilityMessageChooser.prophetPlusWeight = 0.65 22 # UtilityMessageChooser.rdWeight = 0.25 234 private double computeUtility(Message m, DisasterRouter otherRouter) { 235 return this.deliveryPredictabilityWeight * otherRouter.getDeliveryPredictability(m) 236 + this.powerWeight * otherRouter.remainingEnergyRatio() 237 + this.replicationsDensityWeight * (1 - this.attachedRouter.getReplicationsDensity(m)) 238 + this.encounterValueWeight * this.attachedRouter.computeEncounterValueRatio(otherRouter); 239 } 240 241 /** 242 * Determines whether the provided message should be sent to the provided host right now. 243 * This is only the case if the host is not transferring, does not know the message yet, and the message - host 244 * pair's utility is sufficiently high. 245 * @param m Message to check. 246 * @param otherHost Host to check. 247 * @return True iff the message should be sent. 248 */ 249 private boolean shouldBeSent(Message m, DTNHost otherHost) { 448 470 */ 449 471 public void testNonDirectMessageSorting() { 450 472 // Create messages to sort. 451 DisasterData data = new DisasterData(DisasterData.DataType.MARKER, 0, 0, new Coord(0, 0)); 452 Message vipDataMessages = new DataMessage(h1, h3, "D1", data, 0, VERY_HIGH_PRIORITY); UpdateAllNodes chooses the data messages according to what is in the database. All those messages are created automatically and get assigned the same priority. I forgot why we were able to put the data messages into the buffer before, but not with the changes, but I do know that there was some problem.
31 33 public static final int PRIORITY_THRESHOLD = 4; 32 34 public static final double DP_WEIGHT = 0.8; 33 35 36 /* Constants needed for message choosing. */ added Needs Changes and removed Needs Review labels
added Needs Review and removed Needs Changes labels
mentioned in merge request !119 (merged)
added 65 commits
-
59c39fcf...663d9a72 - 63 commits from branch
master
- 72cabf02 - Merge remote-tracking branch 'remotes/origin/master' into feature-#354-utility-message-chooser
- 71d8972c - Merge remote-tracking branch 'remotes/origin/master' into feature-#354-utility-message-chooser
-
59c39fcf...663d9a72 - 63 commits from branch
SonarQube analysis reported 4 issues
-
🔽 1 minor -
ℹ 3 info
-
added 11 commits
-
71d8972c...5927ad62 - 10 commits from branch
master
- 99142ee0 - Merge remote-tracking branch 'remotes/origin/master' into feature-#354-utility-message-chooser
-
71d8972c...5927ad62 - 10 commits from branch
SonarQube analysis reported 5 issues
-
🔽 2 minor -
ℹ 3 info
-
🔽 Remove this unused import 'routing.choosers.EpidemicMessageChooser'.📘 -
🔽 Remove this initialization to "null", the compiler will do that for you.📘 -
ℹ Complete the task associated to this TODO comment.📘 -
ℹ Complete the task associated to this TODO comment.📘 -
ℹ Complete the task associated to this TODO comment.📘
-