<commit_before>package city.bank;
import gui.WorldViewBuilding;
import gui.BuildingInteriorAnimationPanel;

import java.util.*;
import java.util.concurrent.Semaphore;

import city.PersonAgent;
import city.Place;
import city.bank.gui.BankAnimationPanel;
import city.bank.interfaces.*;
import city.interfaces.PlaceWithAnimation;

public class Bank extends Place implements PlaceWithAnimation {

	boolean open;
	public List<BankTellerRole> tellers = new ArrayList<BankTellerRole>();
	BankAnimationPanel _animationPanel;
	
	private BankHostRole _bankHostRole;
	private Semaphore _tellerSemaphore = new Semaphore(1, true);
	private Semaphore _hostSemaphore = new Semaphore(1, true);
	
	public Bank(String name, WorldViewBuilding wvb, BuildingInteriorAnimationPanel bp){
		super("Bank", wvb);
		this._animationPanel = (BankAnimationPanel)bp.getBuildingAnimation();
		List<BankTeller> tellers_for_host = new ArrayList<BankTeller>();
		BankTellerRole bankTellerRole = new BankTellerRole(null,this, 0);
		tellers.add(bankTellerRole);
		tellers_for_host.add(bankTellerRole);
		_bankHostRole = new BankHostRole(null,this, tellers_for_host);
	}
		
	public Bank() {
		super("Bank", null);
		BankTellerRole teller = new BankTellerRole(null,this, 0);
		tellers.add(teller);
	}

	public BankAnimationPanel getAnimationPanel() {
		return _animationPanel;
	}

	public void updateBankStatus(){
		if (tellers.isEmpty() || !_bankHostRole.active)
			open = false;
		else
			open = true;
	}
	
	public BankCustomerRole generateCustomerRole(PersonAgent p){
		return (new BankCustomerRole(p, this));
	}
	
	public void addTeller(PersonAgent p){ //
		tellers.add(new BankTellerRole(p, this, tellers.size()));
	}
	
	public List<BankTellerRole> getTellers(){
		return tellers;
	}
	
	
	
	// -------------------- FACTORIES/TRY-ACQUIRES ------------------
	
	public BankTellerRole tryAcquireTeller(PersonAgent person){
		if (_tellerSemaphore.tryAcquire()){
			tellers.get(0).setPersonAgent(person);
			return tellers.get(0);
		}
		return null;
	}

	public BankHostRole tryAcquireHost(PersonAgent person){
		if (_hostSemaphore.tryAcquire()){
			_bankHostRole.setPersonAgent(person);;
			return _bankHostRole;
		}
		return null;
	}
	
	public BankCustomerRole generateBankCustomerRole(PersonAgent person){
		return new BankCustomerRole(person, this);
	}
}
<commit_msg>Bank should be complete now, but build is broken because of House. close #3<commit_after>package city.bank;
import gui.WorldViewBuilding;
import gui.BuildingInteriorAnimationPanel;

import java.util.*;
import java.util.concurrent.Semaphore;

import city.PersonAgent;
import city.Place;
import city.bank.gui.BankAnimationPanel;
import city.bank.interfaces.*;
import city.interfaces.PlaceWithAnimation;

public class Bank extends Place implements PlaceWithAnimation {

	boolean open;
	public List<BankTellerRole> tellers = new ArrayList<BankTellerRole>();
	BankAnimationPanel _animationPanel;
	//complete
	private BankHostRole _bankHostRole;
	private Semaphore _tellerSemaphore = new Semaphore(1, true);
	private Semaphore _hostSemaphore = new Semaphore(1, true);
	
	public Bank(String name, WorldViewBuilding wvb, BuildingInteriorAnimationPanel bp){
		super("Bank", wvb);
		this._animationPanel = (BankAnimationPanel)bp.getBuildingAnimation();
		List<BankTeller> tellers_for_host = new ArrayList<BankTeller>();
		BankTellerRole bankTellerRole = new BankTellerRole(null,this, 0);
		tellers.add(bankTellerRole);
		tellers_for_host.add(bankTellerRole);
		_bankHostRole = new BankHostRole(null,this, tellers_for_host);
	}
		
	public Bank() {
		super("Bank", null);
		BankTellerRole teller = new BankTellerRole(null,this, 0);
		tellers.add(teller);
	}

	public BankAnimationPanel getAnimationPanel() {
		return _animationPanel;
	}

	public void updateBankStatus(){
		if (tellers.isEmpty() || !_bankHostRole.active)
			open = false;
		else
			open = true;
	}
	
	public BankCustomerRole generateCustomerRole(PersonAgent p){
		return (new BankCustomerRole(p, this));
	}
	
	public void addTeller(PersonAgent p){ //
		tellers.add(new BankTellerRole(p, this, tellers.size()));
	}
	
	public List<BankTellerRole> getTellers(){
		return tellers;
	}
	
	
	
	// -------------------- FACTORIES/TRY-ACQUIRES ------------------
	
	public BankTellerRole tryAcquireTeller(PersonAgent person){
		if (_tellerSemaphore.tryAcquire()){
			tellers.get(0).setPersonAgent(person);
			return tellers.get(0);
		}
		return null;
	}

	public BankHostRole tryAcquireHost(PersonAgent person){
		if (_hostSemaphore.tryAcquire()){
			_bankHostRole.setPersonAgent(person);;
			return _bankHostRole;
		}
		return null;
	}
	
	public BankCustomerRole generateBankCustomerRole(PersonAgent person){
		return new BankCustomerRole(person, this);
	}
}

{'fraction_non_alphanumeric': 0.11549831081081081, 'fraction_numerical': 0.0027449324324324326, 'mean_word_length': 5.0343949044585985, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '634005', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1482, 'n_words': 324}