Write assign_brain_states.