<commit_before>package cellsociety_team05;

import java.util.Random;

public class Sim {
    protected int sim;
    protected int[] params;
    protected SimData gameData;
    protected int[][] map;
    
    public Sim(int sim, int size){
        map=new int[size][size];
        this.sim=sim;
    }
    
    public void initMap (int size, int cellTypes,int[] params) {
        int[] population = new int[cellTypes];
        for(int i=0;i<cellTypes;i++){
            population[i]=(int) Math.pow(size,2)*params[i]/100;
        }
        for(int i=0;i<cellTypes;i++){
            populate(i,population,size);
        }
    }

    protected void populate (int fill, int[] population, int size) {
        int count = 0;
        while(count<population[fill]){
            fillCell(fill,size);
        }
    }
    
    public SimData getData(){
        return new SimData(sim, map);
    }

    private void fillCell (int fill, int size) {
        Random rand = new Random();
        int x = rand.nextInt(size);
        int y = rand.nextInt(size);
        if(!checkCell(x, y, fill)){
            setCell(x, y, fill);
            return;
        }else{
            fillCell(fill, size);
        }
    }
    
    public boolean checkCell(int x, int y, int value){
        if(map[x][y]==value){
            return true;
        }else{
            return false;
        }
    }
    
    public void setCell(int x, int y, int value){
        map[x][y]=value;
    }<commit_msg>minor changes to the boolean in Sim<commit_after>package cellsociety_team05;

import java.util.Random;

public class Sim {
    protected int sim;
    protected int[] params;
    protected SimData gameData;
    protected int[][] map;
    
    public Sim(int sim, int size){
        map=new int[size][size];
        this.sim=sim;
    }
    
    public void initMap (int size, int cellTypes,int[] params) {
        int[] population = new int[cellTypes];
        for(int i=0;i<cellTypes;i++){
            population[i]=(int) Math.pow(size,2)*params[i]/100;
        }
        for(int i=0;i<cellTypes;i++){
            populate(i,population,size);
        }
    }

    protected void populate (int fill, int[] population, int size) {
        int count = 0;
        while(count<population[fill]){
            fillCell(fill,size);
        }
    }
    
    public SimData getData(){
        return new SimData(sim, map);
    }

    private void fillCell (int fill, int size) {
        Random rand = new Random();
        int x = rand.nextInt(size);
        int y = rand.nextInt(size);
        if(!checkCell(x, y, fill)){
            setCell(x, y, fill);
            return;
        }else{
            fillCell(fill, size);
        }
    }
    
    public boolean checkCell(int x, int y, int value){
    	return map[x][y]==value;
    }
    
    public void setCell(int x, int y, int value){
        map[x][y]=value;
    }
{'fraction_non_alphanumeric': 0.12691237830319888, 'fraction_numerical': 0.006258692628650904, 'mean_word_length': 1.9447287615148414, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3722607', 'n_tokens_mistral': 916, 'n_tokens_neox': 893, 'n_words': 236}