public nextValue()

in misc/data-generator/src/data-generator.ts [36:57]


    public nextValue(): number {
        const increment = this.generateRandomWithinBounds(this.minIncrement, this.maxIncrement);
        const operation = this.randomOperation();

        if (operation === Operation.Add) {
            if (this.lastValue + increment > this.max) {
                this.lastValue -= increment;
            } else {
                this.lastValue += increment;
            }
        }

        if (operation === Operation.Subtract) {
            if (this.lastValue - increment < this.min) {
                this.lastValue += increment;
            } else {
                this.lastValue -= increment;
            }
        }

        return this.lastValue;
    }