<commit_before>package eco;

/**
 * This class represents wheat and associated methods, including the wheat
 * stockpile
 * 
 * @author phil, nate, will, connor
 * 
 */

public class Wheat {

	private static int tWheat;
	private static int wheatPrice;

	private static int maxwheat = 5000;
	private static int minwheat = 1000;

	public static int tWheat(int farmers) {
		tWheat += farmers * Farmer.getWheatProductionRate();
		return tWheat;
	}

	public static int eatWheat(int request) {
		if (tWheat < minwheat){
		  int toBuy = minwheat - tWheat;
	          tWheat += Economy.buyWheat(toBuy);		
		}	
		if (request > tWheat) {
			int diff = request - tWheat;
			tWheat = 0;
			return diff;
		} else {
			tWheat -= request;
			return 0;
		}
	}

	public static int gettWheat() {
		return tWheat;
	}

	public static void settWheat(int tWheat) {
		Wheat.tWheat = tWheat;
	}

	public static int getWheatPrice() {
		return wheatPrice;
	}

	public static void update(){
		if (tWheat > maxwheat){
			Economy.sellWheat(tWheat - maxwheat);
			tWheat = maxwheat;	
		}
	}	

	public static void setWheatPrice(int wheatPrice) {
		Wheat.wheatPrice = wheatPrice;
	}

}
<commit_msg>Update Economy.java<commit_after>package eco;

/**
* This class describes the international market for wheat,
* it manages wheat reserve goals and sells or buys to
* meet it.
*
* @Author phil
*/

public class Economy {

	private static int treasury = 0;

	private static int wheatPrice = 10;

	public static int buyWheat(int ammount){
		int neededMoney = wheatPrice * ammount;
		if (neededMoney <= treasury){
			treasury -= neededMoney;
			return ammount;
		}
		else{
			int canBuy = treasury / wheatPrice;
			treasury = 0;
			return canBuy;		
		}
	}

	public static int sellWheat(int ammount){
		treasury += wheatPrice * ammount;
		return ammount;
	}

	public static void updateMarket(int time){
		wheatPrice += Util.randInt(-5, 5); // Biased to increase over time
	}

	public static int getTreasury(){
		System.out.println(treasury);
 		return treasury;	
	}

	public static int getPrice(){
		return wheatPrice;
	}	

}

{'fraction_non_alphanumeric': 0.09635666347075743, 'fraction_numerical': 0.007670182166826462, 'mean_word_length': 3.320910973084886, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1030611', 'n_tokens_mistral': 814, 'n_tokens_neox': 703, 'n_words': 215}