Flexible behaviour regulation in agent based systems