public IParameterStartValuesBuildingBlock CreateFor(IBuildConfiguration buildConfiguration, Simulation simulation) { try { //default default parameter start values matrix _spatialStructure = buildConfiguration.SpatialStructure; _defaultStartValues = _parameterStartValuesCreator.CreateFrom(_spatialStructure, buildConfiguration.Molecules); _formulaCache = _defaultStartValues.FormulaCache; var individual = simulation.Individual; //set the relative expression values for each protein defined in individual foreach (var protein in individual.AllMolecules <IndividualProtein>()) { updateProteinParametersValues(protein); } foreach (var transporter in individual.AllMolecules <IndividualTransporter>()) { updateTransporterParameterValues(transporter); } updateSimulationParameters(simulation); return(_defaultStartValues.WithName(simulation.Name)); } finally { _spatialStructure = null; _defaultStartValues = null; _formulaCache = null; } }
public IParameterStartValuesBuildingBlock CreateFor(IBuildConfiguration buildConfiguration, Simulation simulation) { try { //default default parameter start values matrix var spatialStructure = buildConfiguration.SpatialStructure; var molecules = buildConfiguration.Molecules; _defaultStartValues = _parameterStartValuesCreator.CreateFrom(spatialStructure, molecules); var individual = simulation.Individual; //set the relative expression values for each molecule defined in individual individual.AllMolecules().Each(molecule => updateMoleculeParametersValues(molecule, individual, simulation)); updateSimulationParameters(simulation); return(_defaultStartValues.WithName(simulation.Name)); } finally { _defaultStartValues = null; } }