// create a new truck
Truck truck = new Truck(model, "Truck", true);
// create a new truck arrival event
TruckArrivalEvent truckArrival = new TruckArrivalEvent(model, "TruckArrivalEvent", true);
// and schedule it for the current point in time
truckArrival.schedule(truck, new TimeSpan(0.0));
}
if (!(!produce && model.getTruckQueue().length() == 0)) {
schedule(new TimeSpan(model.getTruckArrivalTime(), TimeUnit.MINUTES));
// from inside to outside...
// draw a new inter-arrival time value
// wrap it in a TimeSpan object
// and schedule this event for the current point in time + the
// inter-arrival time