public override TXRESULT TryTx(Spectrum spectrum) { TXRESULT txResult; if (this.Access == -1) { txResult = TXRESULT.NOTX; } else { bool txCheckingResult = spectrum.CheckAndSetOccupancy(this.Access); if (txCheckingResult) { spectrum.SetMessage(this.generateMessage(), this.Access); txResult = TXRESULT.TXOK; if (this.Access == this.lastAcess) { this.applyBonusAndPenalties(BonusAndPenalties.RHO); } else { this.applyBonusAndPenalties(BonusAndPenalties.SIGMA); } } else { spectrum.SetCollision(this.Access); txResult = TXRESULT.COLLISION; if (this.Access == this.lastAcess) { this.applyBonusAndPenalties(BonusAndPenalties.ALFA); } else { this.applyBonusAndPenalties(BonusAndPenalties.BETA); } } } this.lastAcess = Access; return(txResult); }
public virtual TXRESULT TryTx(Spectrum spectrum) { TXRESULT txResult; if (this.Access <= 0) { txResult = TXRESULT.NOTX; } else { if (spectrum.CheckAndSetOccupancy(this.Access)) { spectrum.SetMessage(this.generateMessage(), this.Access); txResult = TXRESULT.TXOK; } else { spectrum.SetCollision(this.Access); txResult = TXRESULT.COLLISION; } } return(txResult); }
public virtual TXRESULT TryTx(Spectrum spectrum) { TXRESULT txResult; if (this.Access <= 0) { txResult = TXRESULT.NOTX; } else { if (spectrum.CheckAndSetOccupancy(this.Access)) { spectrum.SetMessage(this.generateMessage(), this.Access); txResult = TXRESULT.TXOK; } else { spectrum.SetCollision(this.Access); txResult = TXRESULT.COLLISION; } } return txResult; }
public override TXRESULT TryTx(Spectrum spectrum) { TXRESULT txResult; if (this.Access == -1) { txResult = TXRESULT.NOTX; } else { bool txCheckingResult = spectrum.CheckAndSetOccupancy(this.Access); if (txCheckingResult) { spectrum.SetMessage(this.generateMessage(), this.Access); txResult = TXRESULT.TXOK; if (this.Access == this.lastAcess) { this.applyBonusAndPenalties(BonusAndPenalties.RHO); } else { this.applyBonusAndPenalties(BonusAndPenalties.SIGMA); } } else { spectrum.SetCollision(this.Access); txResult = TXRESULT.COLLISION; if (this.Access == this.lastAcess) { this.applyBonusAndPenalties(BonusAndPenalties.ALFA); } else { this.applyBonusAndPenalties(BonusAndPenalties.BETA); } } } this.lastAcess = Access; return txResult; }