protected override void Context() { _simulation = new ModelCoreSimulation(); var root = new Container(); root.Add(new EventGroup()); _simulation.Model = new Model(); _simulation.Model.Root = root; _simulation.BuildConfiguration = new BuildConfiguration(); var reactionBuildingBlock = new ReactionBuildingBlock(); var reactionAtoB = new ReactionBuilder(); var reactionBtoA = new ReactionBuilder(); var partnerA = new ReactionPartnerBuilder("A", 0); var partnerB = new ReactionPartnerBuilder("B", 0); //Making both reactions dependent on each other reactionAtoB.AddProduct(partnerA); reactionBtoA.AddProduct(partnerB); reactionAtoB.AddEduct(partnerB); reactionBtoA.AddEduct(partnerA); reactionBuildingBlock.Add(reactionAtoB); reactionBuildingBlock.Add(reactionBtoA); _simulation.BuildConfiguration.Reactions = reactionBuildingBlock; }
protected IReactionBuilder CreateReactionForCompoundAndMetabolite(string[] products, params string[] educts) { var reaction = new ReactionBuilder(); educts.Each(educt => reaction.AddEduct(new ReactionPartnerBuilder(educt, 1))); products.Each(product => reaction.AddProduct(new ReactionPartnerBuilder(product, 1))); return(reaction); }
protected ReactionBuilder createReaction() { var reaction = new ReactionBuilder(); reaction.AddEduct(new ReactionPartnerBuilder("educt", 1.0)); reaction.AddProduct(new ReactionPartnerBuilder("product", 1.0)); reaction.AddModifier("modifier"); return(reaction); }
private IEnumerable <IReactionBuilder> getReactions() { var r1 = new ReactionBuilder(); r1.AddEduct(new ReactionPartnerBuilder("C", 2.0)); r1.AddProduct(new ReactionPartnerBuilder("D1", 1.0)); r1.Name = "name"; r1.WithKinetic(new ExplicitFormula("k1*C")); r1.Description = "description"; yield return(r1); yield return(A.Fake <IReactionBuilder>()); }