        // A customer reaches the head of the queue to be served.
public class Serve extends Event {
    public Serve(long eventTime,Customer c, Vendor v){
        super(eventTime);
        vendor = v;
        customer = c;
    }

        // Ask the vendor to serve the customer.
    public void perform(Scheduler scheduler){
        getVendor().serve(getCustomer());
    }

    public String toString(){
        return getWhen()+" Serve";
    }

    protected Customer getCustomer(){
        return customer;
    }

    protected Vendor getVendor(){
        return vendor;
    }

    private final Customer customer;
    private final Vendor vendor;
}
