Buffer
¶
Bases: Edge
Buffer class representing a FIFO queue. Inherits from the Edge class. This buffer can have a single input edge and a single output edge.
Attributes: |
|
---|
Behavior:
The Buffer is a type of edge represents components that holds the items that are waiting to be accepted by the destination node. Items that are added in buffer becomes available
for use after delay
amount of time. It operates in two modes-
1. FIFO
: It prioritizes items in the order they were added, with the oldest items being available for the destination node first.
2. LIFO
: It prioritizes items in the reverse order of their arrival, items that newly added are available to use by the destination node first
Incoming edges can use reserve_get and reserve_put calls on the store in the buffer to reserve an item or space and after yielding
the requests, an item can be put and obtained by using put and get methods.
Raises: |
|
---|
Output performance metrics
The key performance metrics of the buffer edge are captured in the stats
attribute (dict) during a simulation run.
last_state_change_time : Time when the state was last changed.
time_averaged_num_of_items_in_buffer : Time-averaged number of items available in the buffer.
total_time_spent_in_states : Dictionary with total time spent in each state.