if value is None:
self.annealEnergyTermSerial = None
elif value.annealProtocol is self.run.annealProtocol:
self.annealEnergyTermSerial = value.serial
elif self.run.annealProtocol is None:
self.annealEnergyTermSerial = value.serial
self.run.annealProtocol = value.annealProtocol
else:
raise ApiError("%s does not belong to AnnealProtocol %s" % (value, self.run.annealProtocol ))