<commit_before>package city.roles;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Semaphore;

import bank.gui.BankCustomerGui;
import city.BankAgent;
import city.PersonAgent;
import city.interfaces.Bank;
import city.interfaces.BankCustomer;

public class BankCustomerRole extends Role implements BankCustomer{
	
	// Data
	class Task {
		BankingState bs;
		double amount;
		String accountType;
		Task(BankingState bs, double amount, String at) {
			this.bs = bs;
			this.amount = amount;
			this.accountType = at;
		}
	}
	
	public class Loan {
		public double amount;
		public String accountType;	
		public Loan(double amount, String at) {
			this.amount = amount;
			this.accountType = at;
		}
	}
	
	public List<Loan> loans = new CopyOnWriteArrayList<Loan>();
	public List<Task> tasks = new CopyOnWriteArrayList<Task>();
	public Bank bank;
	enum BankingState{WantToCheckBalance, WantToOpenAccount, WantToDeposit, WantToWithdraw, 
		WantToGetALoan, WantToPayBackLoan, WantToAutoPayLoan, CheckingBalance, OpeningAccount, Depositing, Withdrawing, 
		RequestingALoan, PayingLoan };
	public enum CustomerState {None, EnteringBank, InBank, FindingATM, AtAtm, LeavingBank};
	public CustomerState state = CustomerState.None;
	private BankCustomerGui customerGui;
	private Semaphore waitingResponse = new Semaphore(0,true);
	static final int PERSONAL_BROKE_AMOUNT = 100;
	static final int BUSINESS_BROKE_AMOUNT = 500;
	static final int PERSONAL_BROKE_BORROW_AMOUNT = 200;
	static final int BUSINESS_BROKE_BORROW_AMOUNT = 700;
	
	public BankCustomerRole(PersonAgent p) {
		super(p);
	}
	
	
	// Messages
	public void goingToBank() {
		state = CustomerState.EnteringBank;
		stateChanged();
	}<commit_msg>Added default tasks of checking bank account balances when going to the bank.<commit_after>package city.roles;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Semaphore;

import bank.gui.BankCustomerGui;
import city.BankAgent;
import city.PersonAgent;
import city.interfaces.Bank;
import city.interfaces.BankCustomer;

public class BankCustomerRole extends Role implements BankCustomer{
	
	// Data
	class Task {
		BankingState bs;
		double amount;
		String accountType;
		Task(BankingState bs, double amount, String at) {
			this.bs = bs;
			this.amount = amount;
			this.accountType = at;
		}
	}
	
	public class Loan {
		public double amount;
		public String accountType;	
		public Loan(double amount, String at) {
			this.amount = amount;
			this.accountType = at;
		}
	}
	
	public List<Loan> loans = new CopyOnWriteArrayList<Loan>();
	public List<Task> tasks = new CopyOnWriteArrayList<Task>();
	public Bank bank;
	enum BankingState{WantToCheckBalance, WantToOpenAccount, WantToDeposit, WantToWithdraw, 
		WantToGetALoan, WantToPayBackLoan, WantToAutoPayLoan, CheckingBalance, OpeningAccount, Depositing, Withdrawing, 
		RequestingALoan, PayingLoan };
	public enum CustomerState {None, EnteringBank, InBank, FindingATM, AtAtm, LeavingBank};
	public CustomerState state = CustomerState.None;
	private BankCustomerGui customerGui;
	private Semaphore waitingResponse = new Semaphore(0,true);
	static final int PERSONAL_BROKE_AMOUNT = 100;
	static final int BUSINESS_BROKE_AMOUNT = 500;
	static final int PERSONAL_BROKE_BORROW_AMOUNT = 200;
	static final int BUSINESS_BROKE_BORROW_AMOUNT = 700;
	
	public BankCustomerRole(PersonAgent p) {
		super(p);
	}
	
	
	// Messages
	public void goingToBank() {
		state = CustomerState.EnteringBank;
		// default tasks in bank
		tasks.add(new Task(BankingState.WantToCheckBalance, 0, "personal"));
		tasks.add(new Task(BankingState.WantToCheckBalance, 0, "business"));
		stateChanged();
	}
{'fraction_non_alphanumeric': 0.08344513013147303, 'fraction_numerical': 0.007512744834987926, 'mean_word_length': 5.182421227197347, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5698552', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1174, 'n_words': 310}