Class NavModel
Constructors
constructor
-
Parameters
- options: NavOptions = {}
Returns NavModel
Methods
observe
-
records that
routecame aftercontext, newest route last; an empty context is a no-opParameters
- context: readonly string[]
- route: string
Returns void
predict
-
the likely next routes, most probable first; routes with no probability are left out
Parameters
- context: readonly string[]
Returns NavPrediction[]
to JSON
-
the model as a snapshot that fromJSON restores
Returns NavSnapshot
Staticfrom JSON
-
restores a model from toJSON output; throws bad-nav on a malformed snapshot
Parameters
- snapshot: unknown
Optionaloptions: NavOptions
Returns NavModel
Predicts the next route pattern from the ones before it. Counts decay by half every
halfLifeobservations, and a route the model has never seen (in counts or prior) is never predicted.