/// <summary> /// Initializes a new instance of the <see cref="BiasingUpdate"/> class. /// </summary> /// <param name="name">The name of the behavior.</param> /// <param name="simulation">The parallel simulation.</param> public BiasingUpdate(string name, ParallelSimulation simulation) : base(name) { var parameters = simulation.LocalParameters.GetParameterSet <Parameters>(); if (parameters.WorkDistributors.TryGetValue(typeof(IBiasingUpdateBehavior), out var dist) && dist != null) { _updateWorkload = new Workload(dist, parameters.Entities.Count); } }
/// <summary> /// Initializes a new instance of the <see cref="ParallelBindingContext"/> class. /// </summary> /// <param name="entity">The entity.</param> /// <param name="simulation">The simulation for which behaviors are created.</param> /// <param name="behaviors">The behaviors created by the entity.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="entity"/>, <paramref name="simulation"/> or <paramref name="behaviors"/> is <c>null</c>.</exception> public ParallelBindingContext(IEntity entity, ParallelSimulation simulation, IBehaviorContainer behaviors) : base(entity, simulation, behaviors) { }