@Override
	public void run() {
		try {
			long startTime = System.currentTimeMillis();
			long currentTime = startTime;
			Random r = new Random();
			double amount = 1000.0;
			while(isRunning()){
				switch(operations){
				case deposit:
					myBank.deposit(Account.DEFAULT_ACCOUNT_ID, amount);
					break;
				case withdraw:
					myBank.withdraw(Account.DEFAULT_ACCOUNT_ID, amount);
					break;
				case transfer:
					int randomRemoteBankID = r.nextInt(BankUtilities.getNumberOfBanks()) + 1;
					myBank.transfer(Account.DEFAULT_ACCOUNT_ID, randomRemoteBankID, Account.DEFAULT_ACCOUNT_ID, amount);
					break;
				}
				Thread.sleep((r.nextInt(5)+1)*1000);				
				currentTime = System.currentTimeMillis();
				setRunning((currentTime - startTime) <= execTime);
			}
		} catch (InterruptedException e) {
			// TODO transaction is invoked. Set back all amounts.
			e.printStackTrace();
		} catch (AccountException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (BankIDException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}