Similar Code Analysis Report

This document contains the results of performing a similar code analysis of projectscellsociety_team03 at 9/29/16 2:15 PM.

Table of contents

number of lines number of occurrences names of resources
9..8 2 AnimationScene
9 2 FireRules, GameOfLifeRules
6..4 2 CellularAutomata
7 2 PredatorPreyRules
7..5 2 TriangleCell
14 2 PredatorPreyRules, SegregationRules
4 3 CellularAutomata
5..4 2 PredatorPreyRules
1 2 PredatorPreyRules
14..13 2 AnimationScene
9 2 GameOfLifeRules
18 2 PredatorPreyRules, SegregationRules
4 2 PredatorPreyRules
4 2 FireRules, GameOfLifeRules
4 2 PredatorPreyRules
1 2 GameOfLifeRules

List of matches

 

14 lines in PredatorPreyRules, SegregationRules


PredatorPreyRules
/cellsociety_team03/src/CellularAutomata/PredatorPreyRules.java
SegregationRules
/cellsociety_team03/src/CellularAutomata/SegregationRules.java
    private List<Cell> setupCell(){ 
        List<Cell> cellStart = new ArrayList<Cell>(); 
 
        for(int i = 0; i < rowCount*colCount; i++){ 
            if(i<emptyCount){ 
                cellStart.add(new PredatorPreyCell(0,free,-1)); 
            }else if(i < emptyCount + sharkProbCount){ 
                cellStart.add(new PredatorPreyCell(1,shark,maxsE)); 
            }else{       
                cellStart.add(new PredatorPreyCell(2,fish,-1)); 
            } 
        } 
        return cellStart; 
    } 
    private List<Cell> setupCell(){ 
        List<Cell> cellStart = new ArrayList<Cell>(); 
 
        for(int i = 0; i < rowCount*colCount; i++){ 
            if(i<emptyCount){ 
                cellStart.add(new Cell(0,free)); 
            }else if(i < emptyCount + redProbCount){ 
                cellStart.add(new Cell(1,red)); 
            }else{ 
                cellStart.add(new Cell(2,blue)); 
            } 
        } 
        return cellStart; 
    } 
 

13..14 lines in AnimationScene (x2)


AnimationScene
/cellsociety_team03/src/Scene/AnimationScene.java
AnimationScene
/cellsociety_team03/src/Scene/AnimationScene.java
    private void displayHexagonalTiles(){ 
        gc.setStroke(Color.BLUE); 
       for(int i=0;i<myGrid.length;i++){ 
          for(int j=0;j<myGrid[0].length;j++){ 
                          Cell tempCell=myGrid[i][j]; 
                          gc.setFill(tempCell.getColor()); 
 
                gc.strokePolygon(((HexagonalCell)myGrid[i][j]).getXCoordinates(), ((HexagonalCell)myGrid[i][j]).getYCoordinates(), 6); 
                gc.fillPolygon(((HexagonalCell)myGrid[i][j]).getXCoordinates(), ((HexagonalCell)myGrid[i][j]).getYCoordinates(), 6); 
                 
             
          
    } 
    private void displayTriangleTiles(){ 
        gc.setStroke(Color.BLUE); 
        for(int i=0;i<myGrid.length;i++){ 
                for(int j=0;j<myGrid[0].length;j++){ 
                                 
                                Cell tempCell=myGrid[i][j]; 
                                gc.setFill(tempCell.getColor()); 
 
                                gc.strokePolygon(((TriangleCell)myGrid[i][j]).getXCoordinates(), ((TriangleCell)myGrid[i][j]).getYCoordinates(), 3); 
                                gc.fillPolygon(((TriangleCell)myGrid[i][j]).getXCoordinates(), ((TriangleCell)myGrid[i][j]).getYCoordinates(), 3); 
                                 
                        
                
    } 
 

18 lines in PredatorPreyRules, SegregationRules


PredatorPreyRules
/cellsociety_team03/src/CellularAutomata/PredatorPreyRules.java
SegregationRules
/cellsociety_team03/src/CellularAutomata/SegregationRules.java
    private void placeCells(List<Cell> cells){ 
        List<Cell> cellStart = cells; 
        int w = width/colCount; 
        int h = height/rowCount; 
         
        Random r = new Random(); 
        grid = new Cell[rowCount][colCount]; 
        for (int i = 0; i < rowCount; i++){ 
            for(int j = 0; j<colCount; j++){ 
                int randNum = r.nextInt(cellStart.size()); 
                Cell c = cellStart.get(randNum); 
                c.setRowandCol(i, j); 
                c.setXandY(i*w, j*h); 
                grid[i][j] = c; 
                cellStart.remove(randNum); 
            } 
        } 
    } 
    private void placeCells(List<Cell> cells){ 
        List<Cell> cellStart = cells; 
        int w = width/colCount; 
        int h = height/rowCount; 
 
        Random r = new Random(); 
        grid = new Cell[rowCount][colCount]; 
        for (int i = 0; i < rowCount; i++){ 
            for(int j = 0; j<colCount; j++){ 
                int randNum = r.nextInt(cellStart.size()); 
                Cell c = cellStart.get(randNum); 
                c.setRowandCol(i, j); 
                c.setXandY(i*w, j*h); 
                grid[i][j] = c; 
                cellStart.remove(randNum); 
            } 
        } 
    } 
9/29/16 2:15 PM Powered by CodePro Server