Exemplo n.º 1
0
        private void UpdateReactionInfo(BiasingParameters.RareEventInfo tempRareEventInfo, int index)
        {
            var tempReaction  = _reactions.Reactions[index];
            var localeIndex   = LocaleIndex(tempReaction);
            var reactionIndex = ReactionIndex(tempReaction, localeIndex);

            _biasingParameters.Locales[localeIndex].Reactions[reactionIndex].RareEvents.Add(tempRareEventInfo);
        }
Exemplo n.º 2
0
        public void BiasingParametersRareEventInfoConstructor()
        {
            var rareEventInfo = new BiasingParameters.RareEventInfo();

            Assert.AreEqual(0, rareEventInfo.BinCount);
            Assert.IsEmpty(rareEventInfo.Gammas);
            Assert.IsEmpty(rareEventInfo.Thresholds);
        }
Exemplo n.º 3
0
        public void BiasingParametersRareEventInfoBinCountZero()
        {
            const int binCount      = 0;
            var       rareEventInfo = new BiasingParameters.RareEventInfo {
                BinCount = binCount
            };

            Assert.AreEqual(binCount, rareEventInfo.BinCount);
            Assert.AreEqual(binCount, rareEventInfo.Gammas.Length);
            Assert.AreEqual(binCount - 1, rareEventInfo.Thresholds.Length);
        }
Exemplo n.º 4
0
        private void UpdateBiasingParameters(StateDependentGammaInfo gammaInfo, double intermediateRareEvent)
        {
            _biasingParameters.RareEvent.Thresholds.Add(intermediateRareEvent);

            for (int i = 0; i < _reactions.Reactions.Count; i++)
            {
                var tempRareEventInfo = new BiasingParameters.RareEventInfo {
                    BinCount = gammaInfo.IntermediateGamma[i].Count()
                };
                gammaInfo.IntermediateGamma[i].CopyTo(tempRareEventInfo.Gammas, 0);
                gammaInfo.IntermediatePropensityCutoff[i].CopyTo(tempRareEventInfo.Thresholds, 0);
                UpdateReactionInfo(tempRareEventInfo, i);
            }
        }
Exemplo n.º 5
0
        public void BiasingParametersReactionInfoRareEventInfo()
        {
            var         reactionInfo  = new BiasingParameters.ReactionInfo();
            const int   binCount      = 42;
            const float e             = (float)Math.E;
            const float pi            = (float)Math.PI;
            var         rareEventInfo = new BiasingParameters.RareEventInfo {
                BinCount = binCount
            };

            rareEventInfo.Gammas[0]     = e;
            rareEventInfo.Thresholds[1] = pi;
            reactionInfo.RareEvents.Add(rareEventInfo);
            Assert.IsNotEmpty(reactionInfo.RareEvents);
            Assert.AreEqual(rareEventInfo, reactionInfo.RareEvents[0]);
        }
Exemplo n.º 6
0
        public void BiasingParametersLocaleInfoReactions()
        {
            var localeInfo = new BiasingParameters.LocaleInfo {
                Name = "bar"
            };
            var rareEventInfo = new BiasingParameters.RareEventInfo {
                BinCount = 42
            };

            rareEventInfo.Gammas[0]     = Math.E;
            rareEventInfo.Thresholds[1] = Math.PI;
            var reactionInfo = new BiasingParameters.ReactionInfo {
                Name = "foo"
            };

            reactionInfo.RareEvents.Add(rareEventInfo);
            localeInfo.Reactions.Add(reactionInfo);
            Assert.AreEqual(1, localeInfo.ReactionCount);
            Assert.IsNotEmpty(localeInfo.Reactions);
            Assert.AreEqual(reactionInfo, localeInfo.Reactions[0]);
        }