Similar Code Analysis Report

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

Table of contents

number of lines number of occurrences names of resources
12..11 2 GameOfLifeModel, SegregationModel
12 2 SquareManager, TriangleManager
9..8 2 PredatorModel, SegregationModel
11 2 PredatorState, SegregationState
4..3 2 ModelManager
14 2 PredatorModel, SegregationModel
16 2 SegregationCell, PredatorCell
9 3 GameOfLifeCell, SegregationCell, FireCell
5..3 2 GameOfLifeModel, SegregationModel
10 2 SegregationCell, PredatorCell
6 2 PredatorModel, FireModel
11..10 2 GameOfLifeModel, SegregationModel
4 2 PredatorModel, SegregationModel
3 4 PredatorModel, NeighborManager, Model
2 2 PredatorModel, FireModel
6..5 2 PredatorModel
5 4 GameOfLifeCell, SegregationCell, FireCell, PredatorCell
5 2 PredatorModel, FireModel
3 2 PredatorModel
3 2 GameOfLifeModel, FireModel
2 2 GameOfLifeModel, FireModel

List of matches

 

16 lines in SegregationCell, PredatorCell


PredatorCell
/cellsociety_team15/src/Cell/PredatorCell.java
SegregationCell
/cellsociety_team15/src/Cell/SegregationCell.java
   public PredatorCell getNeighborInState(int state){ 
      int inState = neighborsInDoubleState(state); 
      if (inState > 0){ 
         int rand = (int) Math.floor(Math.random()*inState); 
         for (Cell neighbor: myNeighbors){ 
            if (neighbor.getCurrentState() == state 
                  && neighbor.getNextState() == state){ 
               if (rand == 0){ 
                  return (PredatorCell) neighbor; 
               } 
               rand--; 
            } 
         } 
      } 
      return null; 
   } 
   public SegregationCell getNeighborInState(int state){ 
      int inState = neighborsInDoubleState(state); 
      if (inState > 0){ 
         int rand = (int) Math.floor(Math.random()*inState); 
         for (Cell neighbor: myNeighbors){ 
            if (neighbor.getCurrentState() == state 
                  && neighbor.getNextState() == state){ 
               if (rand == 0){ 
                  return (SegregationCell) neighbor; 
               } 
               rand--; 
            } 
         } 
      } 
      return null; 
   } 
9/29/16 2:21 PM Powered by CodePro Server