Class ServicePoint

java.lang.Object
simu.model.ServicePoint

public class ServicePoint extends Object
The ServicePoint class represents a service point in the simulation. It contains a queue of customers and a generator for service times.
  • Constructor Details

    • ServicePoint

      public ServicePoint(ContinuousGenerator generator, EventList eventList, EventType type)
      Constructs a ServicePoint with the specified generator and event list.
      Parameters:
      generator - the continuous generator used to sample the service time
      eventList - the event list to which the service events will be added
  • Method Details

    • addToQueue

      public void addToQueue(List<Customer> a)
      Adds the specified customer to the queue.
      Parameters:
      a - the customer to add
    • fetchFromQueue

      public List<Customer> fetchFromQueue()
      Removes and returns the next customer from the queue.
      Returns:
      the next customer in the queue
    • 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

      public void updateDistribution(ContinuousGenerator newGenerator)
      Updates the service time distribution.
      Parameters:
      newGenerator - the new continuous generator for service times
    • getQueue

      public Collection<List<Customer>> getQueue()
      Returns the queue.
      Returns:
      queue