StandardMultiserver

The StandardMultiserver QPLEX engine is designed for the following queueing model.

A facility consists of a finite number of servers and a staging area (the buffer) with unlimited capacity. Entities (customers, patients, jobs, parts, etc.) seeking service may either be served immediately or must wait in the buffer until a server becomes available. Entities occupy a server while they are in service, and this server can serve no other entity during that time. Entities are served according to some nonpreemptive, nonidling service discipline. All entities exit the system upon completion of service, at which time they release their server.

Applications of this model include healthcare, elections, sports or cultural event planning, manufacturing, and parking. Entities may correspond to patients, voters, event attendees, jobs or parts, and (electric) cars, respectively, while servers may correspond to hospital beds, voting machines or staff, security personnel or ticket scanners, machines, and parking spaces, respectively.

In this model, time is discrete. One unit of model time can correspond to an arbitrarily small period of real time.

The number of entities arriving during the time periods are mutually independent. Service durations of entities beginning service during a time period are mutually independent and identically distributed, and are independent of everything else. Service durations must be at least one time period. All arrivals and service completions occur at the end of a time period.

The arrival and service duration distributions may vary over time. A new service duration distribution affects entities who have not yet entered service. But those already in service are unaffected. The number of servers may also change over time. If the number of servers decreases, it is possible for the number of available servers to be less than the number of entities in the system. In this case, some entities must be removed from service even though their service requirement has not yet been met. Each possible set of such entities is equally likely to be selected for removal and the selected entities return to the buffer and have their service restart with a new (independent) service duration when they are taken into service at a later time.


Because the engine does not use Python dictionaries to store pmfs internally, moving pmf data between Python and an engine requires conversions that consume resources. So it is best avoided if possible. The functions mark() and restore(), respectively, save and restore the engine internally, thus avoiding conversion penalties.


class qplex.StandardMultiserver
__init__()

Constructor.

By default, the system is initially empty, there are no servers, there are no arrivals, and the service durations equal one. Time is set to 0.

apply_observation_range(start_of_range, end_of_range)

Changes the internal state of the engine to eliminate all possibilities that correspond to a number of entities in the system outside the specified range.

Parameters:
  • start_of_range -- Start of the specified range (inclusive).

  • end_of_range -- End of the specified range (exclusive).

apply_observation_value(observed_number_of_entities_in_system)

Changes the internal state of the engine to eliminate all possibilities that correspond to a number of entities in the system other than the specified value.

Parameters:

observed_number_of_entities_in_system -- A nonnegative integer.

current_memory_use

Current amount of memory used by the engine, measured in bytes. Readonly.

Type:

int

get_number_of_entities_in_system_pmf()

Returns the distribution of the number of entities in the system, as determined by the engine's internal state.

Returns:

A pmf.

Return type:

dict

internal_state

A data structure representing the internal state of the engine. For details, see here.

Type:

dict

mark()

Saves the internal state, the engine attributes and the time, so that they can later be restored.

number_of_arrivals_pmf

Pmf of the number of entity arrivals.

Type:

dict

number_of_servers

The number of servers to be used.

Type:

nonnegative int

peak_memory_use

Largest amount of memory used by the engine, measured in bytes. Readonly.

Type:

int

reset_with_number_of_entities_in_system(number_of_entities_in_system)

Restarts the engine with the given number of entities in the system. Current engine attributes are retained. If the number of entities and the number of servers are positive, then eligible entities will enter service immediately, using the service duration distribution currently in effect.

Parameters:

number_of_entities_in_system -- A nonnegative integer.

restore()

Restores the engine as saved by mark(). If mark() has not been called, restarts the engine with default attributes.

service_duration_pmf

Pmf of the service durations. Service durations must be strictly positive.

Type:

dict

step()

Carries out one step of QPLEX calculations and increments the time counter. For details, see here.

time

A counter that is incremented when step() is called.

Type:

int