Possibility

API / publicodes / Possibility

type Possibility = object;

Defined in: packages/core/src/parsePossibilité.ts:11

Represents a single possibility value in a “une possibilité” mechanism. It can be a constant value (string or number), or a reference to an existing rule.

Type declaration

NameTypeDescriptionDefined in
dottedName?stringThe dotted name of the referenced rule, if the possibility is a reference.packages/core/src/parsePossibilité.ts:43
nodeValuestring | numberThe value of the possibility, as it appears in the evaluated node.packages/core/src/parsePossibilité.ts:34
notApplicableASTNodeIf the possibility is a reference, this contains a node that evaluates the applicability conditions of the referenced rule. Otherwise, it contains a constant node evaluating to false (as constant possibility are always applicable, for now)packages/core/src/parsePossibilité.ts:17
publicodesValuestringRepresentation of this possibility’s value in publicodes syntax, can be used in Engine.setSituation to set the value of the rule. String are wrapped in single quotes, and numbers are represented as number followed by an optional unit Example "'value'" "42 m/s"packages/core/src/parsePossibilité.ts:29
type"number" | "string" | "reference"-packages/core/src/parsePossibilité.ts:12
unit?UnitThe unit of the possibility value, if it is a number See serializeUnitpackages/core/src/parsePossibilité.ts:39