/** * Perform a probabilistic transition. * Return the new state. */ public int Transition(int currentState) { if (!validated) { throw new Exception("Please Prepare() model before using."); } return(WeightedRandom.BinarySearchWeightArrayFromSample(binarySearchPModel[currentState], UnityEngine.Random.value)); }