Exemple #1
0
 public override void Populate()
 {
     entropy = entropies.all.Where(e => e.gridCell.value.possible.Count > 1).Min(e => e.entropy);
     minCell = entropies.all.First(e => Math.Abs(e.entropy - entropy) < TOLERANCE);
     i       = entropies.all.IndexOf(minCell);
     x       = i % outputGridPossibilities.width;
     y       = i / outputGridPossibilities.height;
 }
Exemple #2
0
        public override void Populate()
        {
            for (var i = 0; i < 100; i++)
            {
                minEntropyQueue.Clear();

                outputGrid.Populate();
                entropies.Populate();
                minEntropyQueue.AddRange(entropies.all);

                while (minEntropyQueue.Count > 0)
                {
                    first = minEntropyQueue.Dequeue();
                    minEntropy.minCell = first;
                    minEntropy.entropy = first.entropy;
                    minEntropy.x       = first.gridCell.x;
                    minEntropy.y       = first.gridCell.y;
                    collapseCell.Populate();
                    collapseNeighbors.Populate();
                }
            }
        }
 public void Add(Entropies.Item item) => queue.Add(item);