anytree provides a programmatic way to construct a decision-tree schema from named nodes, parent-child relationships, probabilities, costs, and payoffs. The resulting structure can support a Matplotlib visualization of alternative contracts and their uncertain outcomes. section 10.2.1
Contract-options tree
A root named Contract Options can contain Sign with Dodgers and Sign with Yankees. The Dodgers branch can contain Stays Healthy (p=0.75) and Does not stay healthy (p=0.25), each branching into incentive outcomes with assigned payoffs. Expected values combine conditional payoff averages, health probabilities, and agent fees.
