def delta(self) -> None: assert self._value is not None probability = randomness.next_float() if probability < 1.0 / 3.0: self._value += randomness.next_gaussian() * config.INSTANCE.max_delta elif probability < 2.0 / 3.0: self._value += randomness.next_gaussian() else: self._value = round(self._value, randomness.next_int(0, 7))
def randomize_value(self) -> None: if (config.INSTANCE.constant_seeding and StaticConstantSeeding().has_ints and randomness.next_float() <= 0.90): self._value = StaticConstantSeeding().random_int else: self._value = int(randomness.next_gaussian() * config.INSTANCE.max_int)
def randomize_value(self) -> None: if (config.INSTANCE.constant_seeding and StaticConstantSeeding().has_floats and randomness.next_float() <= 0.90): self._value = StaticConstantSeeding().random_float else: val = randomness.next_gaussian() * config.INSTANCE.max_int precision = randomness.next_int(0, 7) self._value = round(val, precision)
def randomize_value(self) -> None: use_seed = ( randomness.next_float() <= config.configuration.seeded_primitives_reuse_probability ) if ( config.configuration.dynamic_constant_seeding and dynamic_constant_seeding.has_ints and use_seed and config.configuration.constant_seeding and randomness.next_float() <= config.configuration.seeded_dynamic_values_reuse_probability ): self._value = dynamic_constant_seeding.random_int elif ( config.configuration.constant_seeding and static_constant_seeding.has_ints and use_seed ): self._value = static_constant_seeding.random_int else: self._value = int(randomness.next_gaussian() * config.configuration.max_int)
def test_next_gaussian(): rand = randomness.next_gaussian() assert isinstance(rand, float)
def delta(self) -> None: assert self._value is not None delta = math.floor(randomness.next_gaussian() * config.INSTANCE.max_delta) self._value += delta