/// <summary> /// Setup the behavior /// </summary> /// <param name="simulation">The simulation</param> /// <param name="provider">The setup data provider</param> public override void Setup(Simulation simulation, SetupDataProvider provider) { if (provider == null) { throw new ArgumentNullException(nameof(provider)); } // Get parameters _bp = provider.GetParameterSet <BaseParameters>(); provider.TryGetParameterSet("model", out _mbp); }
/// <summary> /// Unsetup the behavior /// </summary> /// <param name="simulation">Simulation</param> public override void Unsetup(Simulation simulation) { base.Unsetup(simulation); // Revert the parameter value if (!double.IsNaN(_original)) { _bp.Resistance.RawValue = _original; } // Clear references _bp = null; _mbp = null; }
/// <summary> /// Setup the behavior /// </summary> /// <param name="provider"></param> public override void Setup(SetupDataProvider provider) { if (provider == null) { throw new ArgumentNullException(nameof(provider)); } // Get parameters _bp = provider.GetParameterSet <BaseParameters>("entity"); if (!_bp.Resistance.Given) { _mbp = provider.GetParameterSet <ModelBaseParameters>("model"); } }