This is an interactive simulation demonstrating a fundamental concept in neuroscience and behavioral psychology detailing how the brain's dopamine system processes expectations and rewards.

Through a classic "mouse, light, and reward" conditioning paradigm, users can observe real-time changes in simulated dopamine firing rates across four distinct learning phases.

🧠 What is Reward Prediction Error? Reward Prediction Error is the difference between an expected reward and the actual reward received.

If a reward is unexpectedly received, dopamine firing increases (positive error).

If a reward is expected and received, dopamine spikes at the cue, not the reward (zero error at reward time).

If a reward is expected but omitted, dopamine firing drops below baseline (negative error).

🚀 Features & Phases This application guides the user through four interactive phases, locking progression until the specific learning goal is achieved:

Unexpected (Baseline): Observe how unpredicted rewards cause an immediate dopamine spike.

Association (Training): Pair a visual cue (triggering a light) with a reward. Watch the dopamine spike shift from the reward to the predictive cue as the mouse learns the association.

Omission (Disappointment): Trigger the learned cue but withhold the reward. Observe the famous dopamine "dip" below baseline when expectations are not met.

Extinction & Reinstatement: Repeatedly trigger the cue without a reward to "extinguish" the association. Finally, administer a random reward to instantly "reinstate" the old memory.

🎮 How to Use The simulation features two main interaction buttons and a live-updating graph:

💡 Trigger Signal: Turns on the light cue.

💧 Give Reward: Drops a liquid reward from the dispenser to the mouse.

Walkthrough: Phase 1: Click Give Reward to see the baseline reaction. This unlocks Phase 2.

Phase 2: Click Trigger Signal, wait about 1 second, then click Give Reward. Repeat this 3 times to fully train the mouse and unlock Phase 3.

Phase 3: Click Trigger Signal, but do not give the reward. Watch the graph carefully to see the dopamine drop when the reward fails to drop. This unlocks Phase 4.

Phase 4: Click Trigger Signal multiple times without rewarding the mouse to extinguish the behavior. Once extinguished, click Give Reward to trigger a sudden Reinstatement.