Check decision tree
check_treeUse this when the user wants a decision tree checked without a drawing, for example "do my probabilities add up to 1" or "is anything missing in this tree". Takes the same outline or node list and objective as make_decision_tree. Returns, for each chance node, the sum of its branch probabilities as a fraction and whether it is 1; end nodes without a payoff; probabilities on decision options; payoffs on nodes that have branches; single-option decisions; duplicate branch names; and the depth and node counts against the limits. When nothing is wrong it also gives the root expected value. Refuses a tree it is unable to read (unknown parent, a loop, two roots, over the limits), naming the line or id. Does not draw the tree or make files. Do not use it to estimate probabilities.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | No | The tree as a JSON list instead of outline: each node has id, parent (not for the root), label, and p, cost or payoff as needed, e.g. [{"id":"r","label":"Launch?"},{"id":"a","parent":"r","label":"Do not launch","payoff":0}]. | |
| outline | No | The tree as indented text, one node per line, children indented under their parent (spaces or tabs, "- " bullets allowed). The first line is the root. Fields after the label: p=<probability> on branches of a chance node, cost=<amount> on any branch, payoff=<amount> on end nodes; separate them with spaces or "|". A node whose branches have p is a chance node, a node with branches and no p is a decision, a node with no branches is an end node; "Decision:", "Chance:" or "End:" before a label states the type. Numbers: decimals (0.35, -1,200.50, $300), fractions (1/3), and percents for p (35%). Up to 300 nodes. Example: "Launch? | decision\n Launch | cost=200\n Strong demand | p=0.6 | payoff=1000\n Weak demand | p=0.4 | payoff=-300\n Do not launch | payoff=0". | |
| objective | No | max (default): choose the option with the highest expected value, for profit or gain. min: choose the lowest, when payoffs are costs, losses or time. Example: max. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | ||
| ready | Yes | ||
| shown | No | ||
| counts | Yes | ||
| issues | Yes | ||
| limits | Yes | ||
| objective | Yes | ||
| chance_nodes | Yes |