Ejemplo n.º 1
0
        private IMoleculeStartValuesBuildingBlock createStartValuesBasedOnUsedTemplates(IMoleculeStartValuesBuildingBlock moleculeStartValues)
        {
            var molecules        = BuildingBlockById <IMoleculeBuildingBlock>(moleculeStartValues.MoleculeBuildingBlockId);
            var spatialStructure = BuildingBlockById <ISpatialStructure>(moleculeStartValues.SpatialStructureId);

            return(_startValuesCreator.CreateFrom(spatialStructure, molecules));
        }
Ejemplo n.º 2
0
 private void CreateMoleculeStartValueBuildingBlock(Model model)
 {
     _moleculeStartValuesBuildingBlock = _moleculeStartValuesCreator.CreateFrom(GetMainSpatialStructure(model),
                                                                                MoleculeBuildingBlock)
                                         .WithId(SBMLConstants.SBML_MOLECULESTARTVALUES_BB)
                                         .WithName(SBMLConstants.SBML_MOLECULESTARTVALUES_BB)
                                         .WithDescription(SBMLConstants.SBML_MOLECULESTARTVALUES_DESCRIPTION);
 }
Ejemplo n.º 3
0
        public IMoleculeStartValuesBuildingBlock CreateFor(IBuildConfiguration buildConfiguration, Simulation simulation)
        {
            //default molecule start values matrix
            var compounds          = simulation.Compounds;
            var defaultStartValues = _moleculeStartValuesCreator.CreateFrom(buildConfiguration.SpatialStructure, buildConfiguration.Molecules);

            //set available start formulas for molecules
            setStartFormulasForStaticMolecules(defaultStartValues, simulation, compounds);

            foreach (var protein in simulation.Individual.AllMolecules())
            {
                var allMoleculesObjectPath = moleculesInvolvedInExpression(buildConfiguration.SpatialStructure, protein, simulation.CompoundPropertiesList);
                //path involved expression might not exist in the start values structure=>hence check that they are not null
                var allAvailbleStartValues = allMoleculesObjectPath.Select(objectPath => defaultStartValues[objectPath]).Where(msv => msv != null);
                //the one found should be set to present
                allAvailbleStartValues.Each(msv => msv.IsPresent = true);
            }

            return(defaultStartValues.WithName(simulation.Name));
        }
        private IBuildConfiguration createBuildConfiguration()
        {
            var buildConfiguration = new BuildConfigurationForSpecs();

            buildConfiguration.Molecules          = getMolecules();
            buildConfiguration.Reactions          = getReactions();
            buildConfiguration.SpatialStructure   = getSpatialStructure();
            buildConfiguration.PassiveTransports  = new PassiveTransportBuildingBlock();
            buildConfiguration.Observers          = new ObserverBuildingBlock();
            buildConfiguration.EventGroups        = new EventGroupBuildingBlock();
            buildConfiguration.SimulationSettings = createSimulationConfiguration();


            buildConfiguration.MoleculeStartValues = _moleculeStartValuesCreator.CreateFrom(buildConfiguration.SpatialStructure, buildConfiguration.Molecules);
            var objectPathForContainerThatDoesNotExist = _objectPathFactory.CreateObjectPathFrom("TOTO", "TATA");

            buildConfiguration.MoleculeStartValues.Add(_moleculeStartValuesCreator.CreateMoleculeStartValue(objectPathForContainerThatDoesNotExist, "A", _concentrationDimension));
            buildConfiguration.ParameterStartValues = _parameterStartValuesCreator.CreateFrom(buildConfiguration.SpatialStructure, buildConfiguration.Molecules);

            setMoleculeStartValues(buildConfiguration.MoleculeStartValues);
            return(buildConfiguration);
        }
Ejemplo n.º 5
0
 protected override IMoleculeStartValuesBuildingBlock CreateStartValuesFromDTO(StartValuesDTO dto)
 {
     return(_startValuesCreator.CreateFrom(dto.SpatialStructrue, dto.Molecules).WithName(dto.Name));
 }