StandardNetworkMultiserver
The StandardNetworkMultiserver QPLEX engine is designed for the following queueing model.
There is a network of one or more nodes, each of which represents a standard multiserver queueing model. The numbers of external arrivals and the service durations are assumed to be independent across time periods and nodes.
Entities completing service may be routed to another node (including the one just visited) or may exit the system. The route destination may be random and the probabilities of route destinations from each node may change over time. The route destination of any entity is independent of the route destination of all other entities, and of the arrivals and service durations of all entities. The sum of probabilities from a given source node to all possible destination nodes may be less than one; if so, the remaining probability is the probability of exiting the system.
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.StandardNetworkMultiserver
- __init__(number_of_nodes)
Constructor.
Each node is initialized as in the StandardMultiserver engine: empty, no servers, no arrivals, and service durations equal one. Routing probabilities are all zero (entities leave the system when they complete service). Time is set to zero.
- Parameters:
number_of_nodes -- A strictly positive integer.
- apply_observation_range_at_node(node_index, start_of_range, end_of_range)
Changes the internal state of the engine to eliminate all possibilities that correspond to a number of entities at the specified node outside the specified range.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
start_of_range -- Start of the specified range (inclusive).
end_of_range -- End of the specified range (exclusive).
- apply_observation_value_at_node(node_index, observed_number_of_entities_at_node)
Changes the internal state of the engine to eliminate all possibilities that correspond to a number of entities at the specified node other than the specified value.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
observed_number_of_entities_at_node -- Observed number of entities at the specified node.
- current_memory_use
Current amount of memory used by the engine, measured in bytes. Readonly.
- Type:
int
- get_number_of_entities_at_node_pmf(node_index)
Returns the distribution of the number of entities at the specified node, as determined by the engine's internal state.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
- Returns:
A pmf.
- Return type:
dict
- get_number_of_external_arrivals_at_node_pmf(node_index)
Returns the distribution of the number of entity arrivals from outside the system, at the specified node.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
- Returns:
A pmf.
- Return type:
dict
- get_number_of_nodes()
Returns the number of nodes.
- Return type:
int
- get_number_of_servers_at_node(node_index)
Returns the number of servers at the specified node.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
- Return type:
int
- get_routing_probability(source_node_index, destination_node_index)
Returns the probability of routing an entity completing service at the specified source node to the specified destination node.
- Parameters:
source_node_index -- An integer in the range 0 to number of nodes (exclusive).
destination_node_index -- An integer in the range 0 to number of nodes (exclusive).
- Return type:
real
- get_service_duration_at_node_pmf(node_index)
Returns the distribution of the service duration at the specified node.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
- Returns:
A pmf.
- Return type:
dict
- internal_state
A data structure representing the internal state of the engine. For details, see here.
- Type:
list of dicts
- mark()
Saves the internal state, the engine attributes and the time, so that they can later be restored.
- peak_memory_use
Largest amount of memory used by the engine, measured in bytes. Readonly.
- Type:
int
- reset_node_with_number_of_entities(node_index, number_of_entities_at_node)
Modifies the number of entities at the specified node to the specified number. 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:
node_index -- An integer in the range 0 to number of nodes (exclusive).
number_of_entities_at_node -- A nonnegative integer.
- restore()
Restores the state of the engine saved by
mark()
. Ifmark()
has not been called, restarts the engine with default attributes. The number of nodes remains unchanged.
- set_number_of_external_arrivals_at_node_pmf(node_index, number_of_external_arrivals_pmf)
Sets the distribution of the number of arrivals from outside the system to the specified node.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
number_of_external_arrivals_pmf (dict) -- A pmf.
- set_number_of_servers_at_node(node_index, number_of_servers)
Sets the number of servers at the specified node.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
number_of_servers -- A nonnegative integer.
- set_routing_probability(source_node_index, destination_node_index, probability)
Sets the probability of routing an entity completing service at the specified source node to the specified destination node to the specified probability. The destination node may be the same as the source node.
- Parameters:
source_node_index -- An integer in the range 0 to number of nodes (exclusive).
destination_node_index -- An integer in the range 0 to number of nodes (exclusive).
probability -- The probability that an entity completing service at the specified source node will be routed to the specified destination node.
- set_service_duration_at_node_pmf(node_index, service_duration_pmf)
Sets the distribution of the service duration at the specified node. Service durations must be strictly positive.
- Parameters:
node_index -- An integer in the range 0 to number of nodes (exclusive).
service_duration_pmf (dict) -- A pmf.