StableForSteps

data class StableForSteps<T>(checkInterval: Long, equalIntervals: Long) : Predicate<Environment<T, *>>

A Predicate that tests if an environment's nodes (meaning their position and concentration) have remained unchanged for a certain amount of steps.

The check isn't performed on every step of a simulation, instead an interval that determines how many steps are to be skipped between each check is specified. For test to return true, an environment must remain unchanged for checkInterval * equalIntervals steps. This result might not be entirely consistent, since the check isn't performed every step so as not to cause performance issues. Therefore it might happen that some changes occur in the environment but are reverted before the next check is performed.

test should be called at every step of the simulation in order to avoid missing checks.

Parameters

checkInterval

The recurrence of the test

equalIntervals

The amount of checkInterval intervals that need to pass (during which the environment doesn't change) for test to return true

Constructors

Link copied to clipboard
constructor(checkInterval: Long, equalIntervals: Long)

Creates a new StableForSteps with the given values.

Functions

Link copied to clipboard
open fun and(p0: Predicate<in Environment<T, *>>): Predicate<Environment<T, *>>
Link copied to clipboard
open fun negate(): Predicate<Environment<T, *>>
Link copied to clipboard
open fun or(p0: Predicate<in Environment<T, *>>): Predicate<Environment<T, *>>
Link copied to clipboard
open override fun test(environment: Environment<T, *>): Boolean