/* -------------------------------------------------------- * * Aaron Morris * * CS567 * * Object-Oriented Event-Driven Simulation * * * * Extended SimEvent class representing an event to end the * * simulation. * * -------------------------------------------------------- */ //package datasend; import java.awt.*; public class EndSimEvent extends SimEvent { // Basic Object Constructor. Initialize members of parent SimEvent public EndSimEvent(String EType, int ToArrive) { super.eventType = EType; super.arrivalTime = ToArrive; super.next = null; super.sortValue = ToArrive; } // Override the Base SimEvent Class' Execute with specific Execute // Update Averager stats one last time and write the End Sim message public void execute(EventQueue eventList,Stats stats,int p,RandNum r) { writeExecute(stats.getGlobalTime(),stats); } public void writeExecute(int Time, Stats stats) { stats.report.write("ENDSIM being processed at time " + stats.getGlobalTime()); stats.report.write(" "); stats.report.write("======================="); stats.report.write("Event Simulation Ended"); stats.report.write("======================="); } }