Beispiel #1
0
        protected override void Context()
        {
            base.Context();

            var formula = new ExplicitFormula().WithFormulaString("123").WithName("TOTO");

            formula.AddObjectPath(new FormulaUsablePath(new[] { "Organism", CoreConstants.KeyWords.Molecule }));
            formula.AddObjectPath(new FormulaUsablePath(new[] { "Organism", CoreConstants.Molecule.DrugFcRnComplexTemplate }));
            _reaction = new PKSimReaction().WithName("xx").WithId("xx").WithFormula(formula);
            _reaction.AddEduct(new ReactionPartnerBuilder(CoreConstants.KeyWords.Molecule, 1));
            _reaction.AddEduct(new ReactionPartnerBuilder("XY", 1));
            _reaction.AddProduct(new ReactionPartnerBuilder(CoreConstants.Molecule.DrugFcRnComplexTemplate, 1));
            _reaction.AddModifier(CoreConstants.KeyWords.Molecule);
            _formulaCache = new BuildingBlockFormulaCache();

            A.CallTo(() => _cloneManager.Clone(_reaction)).Returns(_reaction);
        }
Beispiel #2
0
 /// <summary>
 ///     Creates the Educts of the MoBi reaction.
 /// </summary>
 private void CreateEducts(Reaction sbmlReaction, IReactionBuilder reactionBuilder, Model model)
 {
     for (long i = 0; i < sbmlReaction.getNumReactants(); i++)
     {
         var educt = CreateReactionPartner(sbmlReaction.getReactant(i), model);
         if (educt != null)
         {
             reactionBuilder.AddEduct(educt);
         }
     }
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _buildConfiguration = DomainFactoryForSpecs.CreateDefaultConfiguration();
            var molecules = _buildConfiguration.Molecules;

            _moleculeA = new MoleculeBuilder().WithName("A").WithDimension(DomainFactoryForSpecs.AmountDimension);
            _moleculeA.DefaultStartFormula = new ConstantFormula(10);
            molecules.Add(_moleculeA);

            var reactions = _buildConfiguration.Reactions;

            _reactionR1 = new ReactionBuilder().WithName("R1");
            _reactionR1.CreateProcessRateParameter = true;
            _reactionR1.Formula = new ConstantFormula(5);
            _reactionR1.AddEduct(new ReactionPartnerBuilder(_moleculeA.Name, 2));
            reactions.Add(_reactionR1);

            _simulation = DomainFactoryForSpecs.CreateSimulationFor(_buildConfiguration);
        }