Toward distributed context-mediated behavior for multiagent systems