/** * @param dropPercentage A value in the range [0,100] that indicates how many messages should be * dropped. */ public DropMessagesFaultModel(double dropPercentage) { super("DropMessageFaultModel"); if (dropPercentage < 0 || dropPercentage > 100) { throw new RuntimeException("Drop percentage out of range [0,100]: " + dropPercentage); } this.dropPercentage = dropPercentage / 100; // store as a value in the range [0.1] this.random = Harness.getRandomSource().getRandom(); }