count Transitions Until
Simulates the chain forward starting from the startState until the desired state desiredState is reached for the first time and returns the number of transitions required to reach the desired state for the first time.
The chain is advanced from its stream, so consecutive calls are independent observations rather than repetitions of the same walk. The property initialState is left as it was found; state is left at desiredState.
The desired state may be unreachable from the starting state. The transition limit transitionLimit represents the maximum number of transitions allowed before returning. By default, this is 10000. The return value is Int.MAX_VALUE in that case, standing in for infinity. It is a sentinel, not a count: a caller that averages it without checking will get a meaningless number.
Return
one observation of the first passage time from the starting state to the desired state, or Int.MAX_VALUE if the transition limit was reached first.