Class ServicePoint
java.lang.Object
simu.model.ServicePoint
The ServicePoint class represents a service point in the simulation.
It contains a queue of customers and a generator for service times.
-
Constructor Summary
ConstructorsConstructorDescriptionServicePoint(ContinuousGenerator generator, EventList eventList, EventType type) Constructs a ServicePoint with the specified generator and event list. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToQueue(List<Customer> a) Adds the specified customer to the queue.voidBegins a new service, with the customer waiting in the queue during the service.Removes and returns the next customer from the queue.getQueue()Returns the queue.intReturns the size of the queue.booleanReturns true if the queue is not empty.booleanReturns true if the service point is reserved.voidupdateDistribution(ContinuousGenerator newGenerator) Updates the service time distribution.
-
Constructor Details
-
ServicePoint
Constructs a ServicePoint with the specified generator and event list.- Parameters:
generator- the continuous generator used to sample the service timeeventList- the event list to which the service events will be added
-
-
Method Details
-
addToQueue
-
fetchFromQueue
-
getQueueSize
public int getQueueSize()Returns the size of the queue.- Returns:
- the size of the queue
-
beginService
public void beginService()Begins a new service, with the customer waiting in the queue during the service. -
isReserved
public boolean isReserved()Returns true if the service point is reserved.- Returns:
- true if the service point is reserved
-
isInQueue
public boolean isInQueue()Returns true if the queue is not empty.- Returns:
- true if the queue is not empty
-
updateDistribution
Updates the service time distribution.- Parameters:
newGenerator- the new continuous generator for service times
-
getQueue
-