model and controller of agent and contact