/// <summary>
        ///    Ensures that the molecule is using the <paramref name="moleculeFormulaToUse" /> for its start value,
        ///    either directly or via the StartValue parameter.
        /// </summary>
        /// <remarks>
        ///    The <paramref name="moleculeFormulaToUse" /> can be changed since this is suppose to be a clone of the
        ///    original molecule start value
        /// </remarks>
        private void updateMoleculeAmountFormula(IMoleculeAmount molecule, IFormula moleculeFormulaToUse)
        {
            if (moleculeFormulaToUse.IsAmountBased())
            {
                molecule.Formula = moleculeFormulaToUse;
                return;
            }

            //molecule is concentration based
            var startValue = molecule.EntityAt <IParameter>(Constants.Parameters.START_VALUE);

            startValue.Formula   = moleculeFormulaToUse;
            startValue.Dimension = startValue.Formula.Dimension;
            _concentrationBasedFormulaUpdater.UpdateRelativePathForStartValueMolecule(molecule, moleculeFormulaToUse);

            molecule.Formula = _formulaFactory.CreateMoleculeAmountReferenceToStartValue(startValue);
        }
        private void createMoleculeAmountDefaultFormula(IMoleculeBuilder moleculeBuilder, IBuildConfiguration buildConfiguration, IMoleculeAmount moleculeAmount)
        {
            //set start value formula to the default. If user has specified
            //a new start value in MoleculesStartValueCollection-BB, default formula
            //will be overwritten during setting of molecule start values

            var modelFormula = _formulaMapper.MapFrom(moleculeBuilder.DefaultStartFormula, buildConfiguration);

            //amount based, we can just the formula as is
            if (moleculeBuilder.IsAmountBased())
            {
                moleculeAmount.Formula = modelFormula;
                return;
            }

            //create a start value parameter that will be referenced in the molecule formula
            var startValueParameter = _parameterFactory.CreateStartValueParameter(moleculeAmount, modelFormula, moleculeBuilder.DisplayUnit);

            buildConfiguration.AddBuilderReference(startValueParameter, moleculeBuilder);
            moleculeAmount.Add(startValueParameter);
            moleculeAmount.Formula = _formulaFactory.CreateMoleculeAmountReferenceToStartValue(startValueParameter);
        }