Skip to content

Scale

Defined in: src/expressions/scale.ts:12

A degree, not a probability. A scale describes ordered situations and the model returns a position along them. Kept distinct from predicates on purpose: “how much does this disrupt work” is not “is this disruptive”.

Type Parameter Default type
T unknown

new Scale<T>(question, levels, name?): Scale<T>

Defined in: src/expressions/scale.ts:16

Parameter Type
question string
levels readonly EntryType[]
name? string

Scale<T>

Property Modifier Type Defined in
question readonly string src/expressions/scale.ts:17
levels readonly readonly EntryType[] src/expressions/scale.ts:18
name? readonly string src/expressions/scale.ts:19

get top(): number

Defined in: src/expressions/scale.ts:28

Highest level index; scores run from 0 to this.

number

named(name): Scale<T>

Defined in: src/expressions/scale.ts:33

Give the scale a name for traces and plans.

Parameter Type
name string

Scale<T>


toQuestion(): ScoreQuestion

Defined in: src/expressions/scale.ts:38

The Score question this scale compiles to.

ScoreQuestion


toJSON(): unknown

Defined in: src/expressions/scale.ts:43

Serializable form: name, question, and levels.

unknown