Exemplo n.º 1
0
        /// <summary>
        /// Gets all external spatial multipliers
        /// </summary>
        /// <param name="cell"></param>
        /// <param name="iteration"></param>
        /// <param name="timestep"></param>
        /// <param name="transitionGroupId"></param>
        /// <returns></returns>
        private double GetExternalSpatialMultipliers(Cell simulationCell, int iteration, int timestep, int transitionGroupId)
        {
            MultiplierEventArgs args = new MultiplierEventArgs(simulationCell, iteration, timestep, transitionGroupId);

            ApplyingSpatialMultipliers?.Invoke(this, args);
            return(args.Multiplier);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets all external transition multipliers
        /// </summary>
        /// <param name="transitionTypeId"></param>
        /// <param name="iteration"></param>
        /// <param name="timestep"></param>
        /// <param name="simulationCell"></param>
        /// <returns></returns>
        private double GetExternalTransitionMultipliers(int transitionTypeId, int iteration, int timestep, Cell simulationCell)
        {
            if (ApplyingTransitionMultipliers == null)
            {
                return(1.0);
            }

            double         Product = 1.0;
            TransitionType tt      = this.m_TransitionTypes[transitionTypeId];

            foreach (TransitionGroup tg in tt.TransitionGroups)
            {
                MultiplierEventArgs args = new MultiplierEventArgs(simulationCell, iteration, timestep, tg.TransitionGroupId);
                ApplyingTransitionMultipliers?.Invoke(this, args);
                Product *= args.Multiplier;
            }

            return(Product);
        }