event.java

来自「排队论模拟,最近刚刚找到的」· Java 代码 · 共 40 行

JAVA
40
字号
/*
**********************************************************************************************************************
	Wal-Mart Checkout Simulation
	By: Dustin Grimmeissen and Richard Anderson

	-> Event Class

	This class is used to store each event that is placed in the priority queue.  The events store the priority of
	each operation, the customer that they point to, and whether or not they are an arrival or departure event.
**********************************************************************************************************************
*/

public class Event
{
	private int EventType;			// 1 for arrival, 2 for departure
	private long EventPriority;
	public Customer EventCustomer;

	// Constructor
	public Event( Customer ACustomer, long Priority, int Type )
	{
		if (Type == 1)
			EventType = Type;
		else
			EventType = 2;
		EventPriority = Priority;
		EventCustomer = ACustomer;
	}

	public long getPriority()
	{
		return EventPriority;
	}

	public int getType()
	{
		return EventType;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?