/// <summary>
        /// Build the data provider
        /// </summary>
        /// <returns></returns>
        protected override SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors)
        {
            parameters.ThrowIfNull(nameof(parameters));
            behaviors.ThrowIfNull(nameof(behaviors));
            var provider = base.BuildSetupDataProvider(parameters, behaviors);

            // Add behaviors and parameters of the controlling voltage source
            provider.Add("control", behaviors[ControllingName]);
            provider.Add("control", parameters[ControllingName]);
            return(provider);
        }
Beispiel #2
0
        /// <summary>
        /// Build the data provider for setting up a behavior for the entity. The entity can control which parameters
        /// and behaviors are visible to behaviors using this method.
        /// </summary>
        /// <param name="parameters">The parameters in the simulation.</param>
        /// <param name="behaviors">The behaviors in the simulation.</param>
        /// <returns>A data provider for the behaviors.</returns>
        /// <exception cref="ArgumentNullException">
        /// parameters
        /// or
        /// behaviors
        /// </exception>
        protected virtual SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors)
        {
            parameters.ThrowIfNull(nameof(parameters));
            behaviors.ThrowIfNull(nameof(behaviors));

            // By default, we include the parameters of this entity
            var result = new SetupDataProvider();

            result.Add("entity", parameters[Name]);
            result.Add("entity", behaviors[Name]);
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Add inductances to the data provider for setting up behaviors
        /// </summary>
        /// <returns></returns>
        protected override SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors)
        {
            parameters.ThrowIfNull(nameof(parameters));
            behaviors.ThrowIfNull(nameof(behaviors));

            // Base execution (will add entity behaviors and parameters for this mutual inductance)
            var data = base.BuildSetupDataProvider(parameters, behaviors);

            // Register inductor 1
            data.Add("inductor1", parameters[InductorName1]);
            data.Add("inductor1", behaviors[InductorName1]);

            // Register inductor 2
            data.Add("inductor2", parameters[InductorName2]);
            data.Add("inductor2", behaviors[InductorName2]);

            return(data);
        }