Every simulated individual carries a self-efficacy value SE ∈ [0,1] (Bandura) and sits in one of Prochaska & DiClemente's five stages of change. Each simulated week the same discrete-time Markov-chain step runs, exactly as in the 3D version of this simulator:
SE(t+1) = SE(t) + γ · (1 − SE(t)) · (0.15 + I)
Decisional balance: DB = clamp(0.6·I + 0.4·SE − 0.25, 0, 1)
Forward-stage rate: λ_fwd = 0.22 · SE · DB
Relapse rate (Action/Maintenance only):
λ_relapse = ρ · (1 − SE)
P(transition this week) = 1 − e^(−λ)
- Individual mode — one person is advanced week by week; the state-machine diagram above highlights their current stage and the edge labels show the exact probability of moving along each arrow *this* week, computed live from their own SE.
- Population (Monte Carlo) mode — N independent people are simulated in parallel with the identical per-agent rule; the chart becomes a stacked area plot of what fraction of the cohort occupies each stage as weeks pass, which is the real emergent distribution implied by the transition probabilities, not a scripted curve.
- Self-efficacy growth γ — how fast confidence in one's own ability to sustain the change builds (CBT, mastery experiences, coaching).
- Intervention strength I — motivational interviewing, reminders, social support; raises both the decisional balance (more perceived pros vs. cons) and the SE growth ceiling.
- Relapse risk ρ — baseline chance of slipping from Action or Maintenance back to Contemplation; low self-efficacy amplifies it, matching the model's emphasis on relapse as a normal loop rather than a failure endpoint. A relapse always returns to Contemplation — the TTM's "spiral" rather than linear path — and agents never skip a stage forward.
This is the same five-stage model (Precontemplation → Contemplation → Preparation → Action → Maintenance) used in real smoking-cessation, exercise-adoption and medication-adherence interventions.