Пример #1
0
 public DLPAOutputSlot(
     boolean isRequestSlot, int maxDelay, Simulator simulator, Mix mix, DLPABasic dLPABasic) {
   this.dLPABasic = dLPABasic;
   this.mix = mix;
   this.simulator = simulator;
   this.messagesToSend =
       new HashMap<AbstractClient, MixMessage>(simulator.getNumberOfClients() * 2);
   this.isRequestSlot = isRequestSlot;
   this.setTimeOfOutput(Simulator.getNow() + maxDelay);
   this.relatedOutputEvent = new Event(this, getTimeOfOutput(), OutputStrategyEvent.DLPA_TIMEOUT);
   simulator.scheduleEvent(relatedOutputEvent, this);
 }
Пример #2
0
 private MixMessage createDummyMessage(AbstractClient owner, boolean isRequest) {
   NetworkNode source = isRequest ? owner : mix;
   NetworkNode destination = isRequest ? simulator.getDistantProxy() : owner;
   return MixMessage.getInstance(isRequest, source, destination, owner, Simulator.getNow(), true);
 }