public ProximityApproachDetonator(IExploder exploder, Rigidbody exploderRigidBody, float detonationTimeToTarget, float shrapnelSpeed) { _exploderRigidbody = exploderRigidBody; _detonationTimeToTarget = detonationTimeToTarget; _shrapnelSpeed = shrapnelSpeed; _exploder = exploder; }
/// <summary> /// Initializes a new instance of the <see cref="FireworksAlgorithm"/> class. /// </summary> /// <param name="problem">The problem to be solved by the algorithm.</param> /// <param name="stopCondition">The stop condition for the algorithm.</param> /// <param name="settings">The algorithm settings.</param> public FireworksAlgorithm(Problem problem, IStopCondition stopCondition, FireworksAlgorithmSettings settings) : base(problem, stopCondition, settings) { this.Randomizer = new DefaultRandom(); this.BestWorstFireworkSelector = new ExtremumFireworkSelector(problem.Target); this.Distribution = new NormalDistribution(FireworksAlgorithm.normalDistributionMean, FireworksAlgorithm.normalDistributionStdDev); this.InitialSparkGenerator = new InitialSparkGenerator(problem.Dimensions, problem.InitialRanges, this.Randomizer); this.ExplosionSparkGenerator = new ExplosionSparkGenerator(problem.Dimensions, this.Randomizer); this.SpecificSparkGenerator = new GaussianSparkGenerator(problem.Dimensions, this.Distribution, this.Randomizer); this.DistanceCalculator = new EuclideanDistance(problem.Dimensions); this.LocationSelector = new DistanceBasedFireworkSelector(this.DistanceCalculator, this.BestWorstFireworkSelector, this.Settings.LocationsNumber); this.ExploderSettings = new ExploderSettings { ExplosionSparksNumberModifier = settings.ExplosionSparksNumberModifier, ExplosionSparksNumberLowerBound = settings.ExplosionSparksNumberLowerBound, ExplosionSparksNumberUpperBound = settings.ExplosionSparksNumberUpperBound, ExplosionSparksMaximumAmplitude = settings.ExplosionSparksMaximumAmplitude, SpecificSparksPerExplosionNumber = settings.SpecificSparksPerExplosionNumber }; this.Exploder = new Exploder(this.ExploderSettings, this.BestWorstFireworkSelector); }
public void Explode(IExploder Exploder) { Exploder.Explode(this); }
public void Explode(IExploder Exploder) { Exploder.Explode(this); }
public ProximityDetonator(IExploder exploder, Rigidbody exploderRigidBody, float detonationDistance) { _exploderRigidbody = exploderRigidBody; _detonationDistance = detonationDistance; _exploder = exploder; }