def add(self, logical_id, deployment_preference_dict):
if logical_id in self._resource_preferences:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>logical_id=logical_id))<EOL><DEDENT>self._resource_preferences[logical_id] = DeploymentPreference.from_dict(logical_id, deployment_preference_dict)<EOL>
Add this deployment preference to the collection

:raise ValueError if an existing logical id already exists in the _resource_preferences
:param logical_id: logical id of the resource where this deployment preference applies
:param deployment_preference_dict: the input SAM template deployment preference mapping