Managing the Quality of a Resource with Stock and Flow Controls