/// <summary> /// インスタンスを生成します。 /// 指定する設定は、パーティション マネージャのインスタンス化後に外部から変更しても反映されません。 /// </summary> /// <param name="settings">パーティション マネージャ設定。</param> public PartitionManager(Settings settings) { if (settings == null) { throw new ArgumentNullException("settings"); } PartitionSize = settings.PartitionSize; clusterManager = new ClusterManager(settings.ClusterSize, settings.PartitionSize); partitions = new Queue <Partition>(); activationCapacity = settings.ActivationCapacity; passivationCapacity = settings.PassivationCapacity; passivationSearchCapacity = settings.PassivationSearchCapacity; activatingParitions = new ConcurrentDictionary <IntVector3, Partition>(activationCapacity, activationCapacity); passivatingPartitions = new ConcurrentDictionary <IntVector3, Partition>(passivationCapacity, passivationCapacity); maxActiveVolume = settings.MaxActiveVolume ?? new DefaultActiveVolume(8); var minActiveVolume = settings.MinActiveVolume ?? new DefaultActiveVolume(4); activationCandidateFinder = new ActivationCandidateFinder(this, minActiveVolume, settings.PriorActiveDistance); activatePartitionAction = new WaitCallback(ActivatePartition); passivatePartitionAction = new WaitCallback(PassivatePartition); }
/// <summary> /// インスタンスを生成します。 /// </summary> /// <param name="manager">パーティション マネージャ。</param> /// <param name="volume">アクティブ領域。</param> /// <param name="priorDistance">アクティブ化優先距離。</param> public ActivationCandidateFinder(PartitionManager manager, IActiveVolume volume, float priorDistance) { this.manager = manager; this.volume = volume; collectAction = new Action <IntVector3>(Collect); comparer = new CandidateComparer(priorDistance); candidates = new PriorityQueue <Candidate>(candidateQueueCapacity, comparer); thread = new Thread(Run); thread.IsBackground = true; }
/// <summary> /// インスタンスを生成します。 /// 指定する設定は、パーティション マネージャのインスタンス化後に外部から変更しても反映されません。 /// </summary> /// <param name="settings">パーティション マネージャ設定。</param> public PartitionManager(Settings settings) { if (settings == null) throw new ArgumentNullException("settings"); PartitionSize = settings.PartitionSize; clusterManager = new ClusterManager(settings.ClusterSize, settings.PartitionSize); partitions = new Queue<Partition>(); activationCapacity = settings.ActivationCapacity; passivationCapacity = settings.PassivationCapacity; passivationSearchCapacity = settings.PassivationSearchCapacity; activatingParitions = new ConcurrentDictionary<IntVector3, Partition>(activationCapacity, activationCapacity); passivatingPartitions = new ConcurrentDictionary<IntVector3, Partition>(passivationCapacity, passivationCapacity); maxActiveVolume = settings.MaxActiveVolume ?? new DefaultActiveVolume(8); var minActiveVolume = settings.MinActiveVolume ?? new DefaultActiveVolume(4); activationCandidateFinder = new ActivationCandidateFinder(this, minActiveVolume, settings.PriorActiveDistance); activatePartitionAction = new WaitCallback(ActivatePartition); passivatePartitionAction = new WaitCallback(PassivatePartition); }