@Override
	public void render(BufferedImage target) {
		// get the graphics object
		Graphics2D context = target.createGraphics();
		background(context, target.getWidth(), target.getHeight());

		// environment background
		final Color background = new Color(255, 0, 255, 50);
		context.setColor(background);
		context.fillRect(0, 0, Constants.WORLD_WIDTH, Constants.WORLD_HEIGHT);

		// draw the grid
		context.setColor(Color.CYAN);
		final int TILE_BUFFER = (int) (Constants.CELL_DISTANCE * (0.1));
		for (int i = 0; i < e.length; ++i)
			for (int j = 0; j < e[0].length; ++j) {
				// don't draw un-available cells
				if (!e[i][j].available)
					continue;

				// draw cell according to it's color
				final Color noResource = new Color(155, 155, 155, 200);
				final Color yesResource = new Color(0, 255, 0, 200);
				context.setColor(e[i][j].Color ? yesResource : noResource);
				int x = gridToPixel(i);
				int y = gridToPixel(j);
				context.fillRect(x - (Constants.CELL_DISTANCE / 2)
						+ TILE_BUFFER, y - (Constants.CELL_DISTANCE / 2)
						+ TILE_BUFFER, Constants.CELL_DISTANCE
						- (2 * TILE_BUFFER), Constants.CELL_DISTANCE
						- (2 * TILE_BUFFER));
			}

		// draw the agents
		final int AGENT_RADIUS = Constants.CELL_DISTANCE / 2 - 4;
		final Stroke stroke = new BasicStroke(2.0f);
		final Color ringColor = new Color(255, 255, 0, 255);
		for (int i = 0; i < aStats.length; ++i) {
			Astats a = aStats[i];
			if (!a.alive && a.x == a.x0 && a.y == a.y0)
				continue;

			int x = gridToPixel(lerp(aStats[i].x0, aStats[i].x,
					Math.min((float) m_moveCounter * 3, 1f)));
			int y = gridToPixel(lerp(aStats[i].y0, aStats[i].y,
					Math.min((float) m_moveCounter * 3, 1f)));

			context.setColor(aStats[i].color(fullC));
			context.fillOval(x - (AGENT_RADIUS) + 2, y - (AGENT_RADIUS) + 2,
					AGENT_RADIUS * 2 - 2, AGENT_RADIUS * 2 - 2);

			Stroke backup = context.getStroke();
			context.setStroke(stroke);
			context.setColor(ringColor);
			context.drawOval(x - (AGENT_RADIUS) + 2, y - (AGENT_RADIUS) + 2,
					AGENT_RADIUS * 2 - 2, AGENT_RADIUS * 2 - 2);
			context.setStroke(backup);
		}
	}