Package info.fluxprojects.fluxant.core

Examples of info.fluxprojects.fluxant.core.Position


        int correctedCol = col % getCols(array);
        return correctedCol < 0 ? correctedCol + getCols(array) : correctedCol;
    }

    public static Position getPosition(Position position, Direction direction, int cols, int rows) {
        return new Position(
                getCorrectedCol(position.getCol() + direction.getColDelta(), cols),
                getCorrectedRow(position.getRow() + direction.getRowDelta(), rows)
        );
    }
View Full Code Here


    private void calcDiffusionMap(long[][] diffusionMap) {
        long[][] originalDiffusionMap = copyArray(diffusionMap);
        for (int c = 0; c < cols; c++) {
            for (int r = 0; r < rows; r++) {
                Position cp = new Position(c, r);
                Position np = MapUtils.getPosition(cp, Direction.NORTH, cols, rows);
                Position ep = MapUtils.getPosition(cp, Direction.EAST, cols, rows);
                Position sp = MapUtils.getPosition(cp, Direction.SOUTH, cols, rows);
                Position wp = MapUtils.getPosition(cp, Direction.WEST, cols, rows);

                long cv = originalDiffusionMap[c][r];
                long nv = originalDiffusionMap[np.getCol()][np.getRow()];
                long ev = originalDiffusionMap[ep.getCol()][ep.getRow()];
                long sv = originalDiffusionMap[sp.getCol()][sp.getRow()];
                long wv = originalDiffusionMap[wp.getCol()][wp.getRow()];

                double nd = (nv - cv) / DIFFUSION_FACTOR;
                double ed = (ev - cv) / DIFFUSION_FACTOR;
                double sd = (sv - cv) / DIFFUSION_FACTOR;
                double wd = (wv - cv) / DIFFUSION_FACTOR;
View Full Code Here

TOP

Related Classes of info.fluxprojects.fluxant.core.Position

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.