<commit_before>package edu.wheaton.simulator.gui;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
import edu.wheaton.simulator.entity.Agent;
import edu.wheaton.simulator.simulation.GUIToAgentFacade;

public class GridPanel extends JPanel {

	private static final long serialVersionUID = -20L;

	private ScreenManager sm;

	private int width;
	
	private int height;

	private int gridWidth;
	
	private int gridHeight;
	
	public GridPanel(ScreenManager sm) {
		this.sm = sm;
	}

	public void paint(Graphics g) {
		width = this.getWidth();
		height = this.getHeight();
		gridWidth = sm.getGUIwidth();
		gridHeight = sm.getGUIheight();
		int pixelWidth = width / gridWidth;
		int pixelHeight = height / gridHeight;
		int squareSize = Math.min(pixelWidth, pixelHeight);
		for (int i = 0; i < gridWidth; i++) {
			for (int j = 0; j < gridHeight; j++) {
				g.drawRect(squareSize * i, squareSize * j, 
						   squareSize, squareSize);
			}
		}
	}

	public void agentPaint(Graphics g){
		width = this.getWidth();
		height = this.getHeight();
		gridWidth = sm.getGUIwidth();
		gridHeight = sm.getGUIheight();
		int pixelWidth = width / gridWidth;
		int pixelHeight = height / gridHeight;
		int squareSize = Math.min(pixelWidth, pixelHeight) - 1;
		for (int i = 0; i < gridWidth; i++) {
			for (int j = 0; j < gridHeight; j++) {
				Agent a = sm.getFacade().getAgent(i, j);
				if(a instanceof Agent){
					g.setColor(a.getColor());
					g.fillRect(squareSize * i, squareSize * j, 
							   squareSize, squareSize);
				}
			}
		}
	}
}<commit_msg>Agents now print as icons using the byteArray<commit_after>package edu.wheaton.simulator.gui;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
import edu.wheaton.simulator.entity.Agent;
import edu.wheaton.simulator.simulation.GUIToAgentFacade;

public class GridPanel extends JPanel {

	private static final long serialVersionUID = -20L;

	private ScreenManager sm;

	private int width;

	private int height;

	private int gridWidth;

	private int gridHeight;

	public GridPanel(ScreenManager sm) {
		this.sm = sm;
	}

	public void paint(Graphics g) {
		width = this.getWidth();
		height = this.getHeight();
		gridWidth = sm.getGUIwidth();
		gridHeight = sm.getGUIheight();
		int pixelWidth = width / gridWidth;
		int pixelHeight = height / gridHeight;
		int squareSize = Math.min(pixelWidth, pixelHeight);
		for (int i = 0; i < gridWidth; i++) {
			for (int j = 0; j < gridHeight; j++) {
				g.drawRect(squareSize * i, squareSize * j, 
						squareSize, squareSize);
			}
		}
	}

	public void agentPaint(Graphics g){
		width = this.getWidth();
		height = this.getHeight();
		gridWidth = sm.getGUIwidth();
		gridHeight = sm.getGUIheight();
		int pixelWidth = width / gridWidth;
		int pixelHeight = height / gridHeight;
		int squareSize = Math.min(pixelWidth, pixelHeight) - 1;
		for (int i = 0; i < gridWidth; i++) {
			for (int j = 0; j < gridHeight; j++) {
				Agent agent = sm.getFacade().getAgent(i, j);
				if(agent instanceof Agent){
					g.setColor(agent.getColor());
					//If the square is going to be too small
					//for an icon don't make icons
					if(squareSize < 10){
						g.fillRect(squareSize * i, squareSize * j, 
								squareSize, squareSize);
					}
					//Otherwise make icons
					else{
						int iconSize = squareSize/8;
						for (int a = 0; i < squareSize; i+=iconSize) {
							for (int b = 0; j <  squareSize; j+=iconSize) {
								byte[] icon = agent.getDesign();
								byte val = new Byte("00000001");
								if((icon[a]&(val<<b)) == 1){
									g.fillRect((squareSize * i) + a*iconSize,
											(squareSize * j) + b*iconSize, 
											iconSize, iconSize);
								}
							}
						}
					}
				}
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.12536676447052547, 'fraction_numerical': 0.007468658308882369, 'mean_word_length': 3.0716612377850163, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '518645', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1239, 'n_words': 342}