Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transient"/> class.
 /// </summary>
 /// <param name="name">The name of the simulation.</param>
 public Transient(string name)
     : base(name)
 {
     TimeParameters = new Trapezoidal();
     Statistics     = new TimeSimulationStatistics();
     _time          = new SimulationState();
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transient"/> class.
 /// </summary>
 /// <param name="name">The name of the simulation.</param>
 /// <param name="parameters">The time parameters.</param>
 public Transient(string name, TimeParameters parameters)
     : base(name)
 {
     TimeParameters = parameters.ThrowIfNull(nameof(parameters));
     Statistics     = new TimeSimulationStatistics();
     _time          = new SimulationState();
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transient"/> class.
 /// </summary>
 /// <param name="name">The name of the simulation.</param>
 /// <param name="step">The step size.</param>
 /// <param name="final">The final time.</param>
 public Transient(string name, double step, double final)
     : base(name)
 {
     TimeParameters = new Trapezoidal {
         InitialStep = step, StopTime = final
     };
     Statistics = new TimeSimulationStatistics();
     _time      = new SimulationState();
 }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeSimulation"/> class.
        /// </summary>
        /// <param name="name">The identifier of the simulation.</param>
        protected TimeSimulation(string name) : base(name)
        {
            Configurations.Add(new TimeConfiguration());
            TimeSimulationStatistics = new TimeSimulationStatistics();
            Statistics.Add(typeof(TimeSimulationStatistics), TimeSimulationStatistics);

            // Add the behavior in the order they are (usually) called
            BehaviorTypes.AddRange(new []
            {
                typeof(ITimeBehavior),
                typeof(IAcceptBehavior)
            });
        }