Matrix
public typealias Matrix<T> = [T : Vector<T>]
Undocumented
-
All the unique states present in the current matrix. Even though it’s a from or to state only, it will be counted as a unique state.
Complexity
O(n log n), where n is the matrix’s sizeDeclaration
Swift
public var uniqueStates: [Key] { get }
-
Given a current state, this method returns the probabilities of the next state.
Complexity
O(1), regardless the matrix’s size.
Declaration
Swift
public func probabilities(given: Key) -> Vector<Key>
Parameters
given
The current state.
Return Value
A dictionary of the probabilities, where the states are the keys and the values are the probability from the current state.
-
Given a current state, this method returns the next state, based on an input criteria.
Complexity
O(n), where n is the length of the possible transitions for the given states.
Declaration
Swift
public func next(given: Key, process: DecisionProcess = .predict) -> Key?
Parameters
given
The current state
process
The decision process to calculate the next state.
Return Value
The calculated next state.
-
A pretty printed representation of the matrix
From | 1.00 0.00 0.00 | | | | 0.00 1.00 0.00 | To | | | 0.00 0.00 1.00 |
Declaration
Swift
public var description: String { get }