Ejemplo n.º 1
0
 public CoreSolver(OutputGrid outputGrid, PatternManager patternManager)
 {
     this.outputGrid        = outputGrid;
     this.patternManager    = patternManager;
     this.coreHelper        = new CoreHelper(this.patternManager);
     this.propagationHelper = new PropragationHelper(this.outputGrid, this.coreHelper);
 }
        public CoreHelper(PatternManager manager)
        {
            patternManager = manager;

            for (int i = 0; i < patternManager.GetNuberOfPatterns(); i++)
            {
                totalFrequency += patternManager.GetPatternFrequency(i);
            }
            totalFrequencyLog = Mathf.Log(totalFrequency, 2);
        }
Ejemplo n.º 3
0
        public CoreHelper(PatternManager manager)
        {
            patternManager = manager;

            /* for (int i = 0; i < patternManager.GetNumberOfPatterns(); i++)
             * {
             *    totalFrequency += patternManager.getPatternFrequency(i);
             *
             * }
             *
             * totalFrequencyLog = Mathf.Log(totalFrequency, 2);*/
        }
Ejemplo n.º 4
0
        public void CreateOutput(PatternManager manager, int[][] outputValues, int width, int height)
        {
            if (outputValues.Length == 0)
            {
                return;
            }
            this.outputImage.ClearAllTiles();

            int[][] valueGrid;
            valueGrid = manager.ConvertPatternToValues <TileBase>(outputValues);

            for (int row = 0; row < height; row++)
            {
                for (int col = 0; col < width; col++)
                {
                    TileBase tile = (TileBase)this.valuesManager.GetValueFromIndex(valueGrid[row][col]).Value;
                    this.outputImage.SetTile(new Vector3Int(col, row, 0), tile);
                }
            }
        }
Ejemplo n.º 5
0
Archivo: WFCCore.cs Proyecto: f15h96/AI
 public WFCCore(int outputWidth, int outputHeight, int maxIterations, PatternManager patternManager)
 {
     this.patternManager = patternManager;
     this.outputGrid     = new OutputGrid(outputWidth, outputHeight, patternManager.GetNumberOfPatterns());
     this.maxIterations  = maxIterations;
 }