<commit_before>package Transportation;

import trace.AlertLog;
import trace.AlertTag;
import agent.Agent;
import gui.agentGuis.TruckVehicleGui;
import interfaces.Car;

public class DeliveryTruckAgent extends Agent implements Car{
	public DeliveryTruckAgent(String name) {
		destination = "N/A";
		state = CarState.parked;
		this.name = name;
		
		
		this.setGui(new TruckVehicleGui(name));
		this.startThread();
	}
	
	
	//Data
	String name = null;
	private TruckVehicleGui agentGui = null;
	
	private String destination = new String(); 
	private CarState state;
	public enum CarState {parked, driving};
	
	
	//Messages
	
	public void msgNewDestination(String destination) {
		this.destination = destination;
		this.state = CarState.driving;
		stateChanged();
	}
	

	//Scheduler
	@Override
	protected boolean pickAndExecuteAnAction() {

		if (state == CarState.driving) {
			goToDestination();
			return true;
		}

		return false;
	}
	
	//Actions
	private void goToDestination() {
		
		agentGui.DoGoTo(destination);
		AlertLog.getInstance().logMessage(AlertTag.VEHICLE_GUI, name, "Arrived at " + destination);
		
	}
	
	
	
	
	
	
	
	
	//Utilities
	public void setGui(TruckVehicleGui truckGui){
		this.agentGui = truckGui;
	}
	
	
	
	public String toString(){
		return "" + name;
	}
	
	public String getName(){
		return name;
	}
	
}<commit_msg>added a  queue to the delivery truck. It will now go to all destinations.<commit_after>package Transportation;

import java.util.LinkedList;
import java.util.Queue;

import trace.AlertLog;
import trace.AlertTag;
import agent.Agent;
import gui.agentGuis.TruckVehicleGui;
import interfaces.Car;

public class DeliveryTruckAgent extends Agent implements Car{
	
	
	/** Constructor for Delivery Truck
	 * 
	 * @param name
	 */
	public DeliveryTruckAgent(String name) {
		state = CarState.parked;
		this.name = name;
		
		this.setGui(new TruckVehicleGui(name));
		this.startThread();
	}
	
	
	//Data
	String name = null;
	private TruckVehicleGui agentGui = null;
	
	private Queue<String> destination = new LinkedList<>(); 
	private CarState state;
	public enum CarState {parked, driving};
	
	
	//Messages
	
	public void msgNewDestination(String destination) {
		this.destination.offer(destination);
		this.state = CarState.driving;
		stateChanged();
	}
	

	//Scheduler
	@Override
	protected boolean pickAndExecuteAnAction() {

		if (state == CarState.driving) {
			goToDestination();
			return true;
		}

		return false;
	}
	
	//Actions
	private void goToDestination() {
		if(destination.size() == 0){
			state = CarState.parked;
			return;
		}
		
		String dest;
		dest = destination.poll();
		
		agentGui.DoGoTo(dest);
		AlertLog.getInstance().logMessage(AlertTag.VEHICLE_GUI, name, "Arrived at " + destination);
		
	}
	
	
	
	
	
	
	
	
	//Utilities
	public void setGui(TruckVehicleGui truckGui){
		this.agentGui = truckGui;
	}
	
	
	
	public String toString(){
		return "" + name;
	}
	
	public String getName(){
		return name;
	}
	
}
{'fraction_non_alphanumeric': 0.10458839406207827, 'fraction_numerical': 0.00033738191632928474, 'mean_word_length': 3.6546310832025117, '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': '2128616', 'n_tokens_mistral': 1090, 'n_tokens_neox': 936, 'n_words': 233}