Skip to content

Commit

Permalink
deployment-agnostic seed for gossip strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
keznikl committed Apr 8, 2014
1 parent 93da9b0 commit 8f04bd6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(String[] args) throws AnnotationProcessorException, IOEx
final AreaBasedSelector directRecipientSelector = new AreaBasedSelector();
directRecipientSelector.initialize(AreaNetworkRegistry.INSTANCE);

final Random rnd = new Random(componentCfg.hashCode());
final Random rnd = new Random(areas.size());
final DirectGossipStrategy directGossipStrategy = new DirectGossipStrategy() {
@Override
public Collection<String> filterRecipients(
Expand Down Expand Up @@ -156,6 +156,10 @@ public Collection<String> filterRecipients(
i++;
}

int seed = omnetConfig.toString().hashCode();
System.out.println(String.format("Using Gossip Strategy seed %d.", seed));
rnd.setSeed(seed);

String confName = "omnetpp";
if (args.length >= 3) {
confName = args[2];
Expand Down

0 comments on commit 8f04bd6

Please sign in to comment.