customer.java

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

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

	-> Customer Class

	This class stores information for each customer that is generated by the simulation program.
**********************************************************************************************************************
*/

public class Customer
{
	private long ArrivalTime;
	private long ServiceStartTime;
	private long DepartureTime;
	private int Lane;
	public Customer NextInLine;

	// Constructor
	public Customer( long Time )
	{
		ArrivalTime = Time;
		NextInLine = null;
	}

	// Customer has entered a server
	public void BeginService( long Time )
	{
		ServiceStartTime = Time;
	}

	// Customer has departed
	public void EndService( long Time )
	{
		DepartureTime = Time;
	}

	public long getArrivalTime()
	{
		return ArrivalTime;
	}

	public long getServiceStartTime()
	{
		return ServiceStartTime;
	}

	public long getDepartureTime()
	{
		return DepartureTime;
	}

	// Set the checkout lane a customer goes to
	public void setLane( int theLane )
	{
		Lane = theLane;
	}

	public int getLane()
	{
		return Lane;
	}
}

⌨️ 快捷键说明

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