Exemplo n.º 1
0
        /// <summary>
        /// Set up the simulation.
        /// </summary>
        /// <param name="entities">The circuit that will be used.</param>
        /// <exception cref="ArgumentNullException">circuit</exception>
        protected override void Setup(EntityCollection entities)
        {
            entities.ThrowIfNull(nameof(entities));
            base.Setup(entities);

            // Get behaviors
            _noiseBehaviors = EntityBehaviors.GetBehaviorList <INoiseBehavior>();

            // Get behaviors, parameters and states
            NoiseConfiguration = Configurations.Get <NoiseConfiguration>();
            NoiseState         = new NoiseState();
            NoiseState.Setup(Variables);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Destroys the simulation.
        /// </summary>
        protected override void Unsetup()
        {
            // Remove references
            NoiseState.Unsetup();
            NoiseState = null;
            for (var i = 0; i < _noiseBehaviors.Count; i++)
            {
                _noiseBehaviors[i].Unbind();
            }
            _noiseBehaviors    = null;
            NoiseConfiguration = null;

            base.Unsetup();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Unsetup the simulation
        /// </summary>
        protected override void Unsetup()
        {
            // Remove references
            NoiseState.Destroy();
            NoiseState = null;
            for (int i = 0; i < NoiseBehaviors.Count; i++)
            {
                NoiseBehaviors[i].Unsetup();
            }
            NoiseBehaviors     = null;
            NoiseConfiguration = null;

            base.Unsetup();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Setup the simulation
        /// </summary>
        /// <param name="circuit">Circuit</param>
        protected override void Setup(Circuit circuit)
        {
            if (circuit == null)
            {
                throw new ArgumentNullException(nameof(circuit));
            }
            base.Setup(circuit);

            // Get behaviors, parameters and states
            NoiseConfiguration = ParameterSets.Get <NoiseConfiguration>();
            NoiseBehaviors     = SetupBehaviors <NoiseBehavior>(circuit.Objects);
            NoiseState         = States.Get <NoiseState>();
            NoiseState.Initialize(Nodes);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Set up the simulation.
        /// </summary>
        /// <param name="circuit">The circuit that will be used.</param>
        /// <exception cref="ArgumentNullException">circuit</exception>
        protected override void Setup(Circuit circuit)
        {
            if (circuit == null)
            {
                throw new ArgumentNullException(nameof(circuit));
            }
            base.Setup(circuit);

            // Get behaviors, parameters and states
            NoiseConfiguration = Configurations.Get <NoiseConfiguration>();
            _noiseBehaviors    = SetupBehaviors <BaseNoiseBehavior>(circuit.Entities);
            NoiseState         = new NoiseState();
            NoiseState.Setup(Variables);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Set up the simulation.
        /// </summary>
        /// <param name="entities">The circuit that will be used.</param>
        /// <exception cref="ArgumentNullException">circuit</exception>
        protected override void Setup(EntityCollection entities)
        {
            if (entities == null)
            {
                throw new ArgumentNullException(nameof(entities));
            }
            base.Setup(entities);

            // Get behaviors
            _noiseBehaviors = EntityBehaviors.GetBehaviorList <INoiseBehavior>();

            // Get behaviors, parameters and states
            NoiseConfiguration = Configurations.Get <NoiseConfiguration>();
            NoiseState         = new NoiseState();
            NoiseState.Setup(Variables);
        }