Full Library / Resource / Timed-Queue / TimedQueue_Priority
Block Name: TimedQueue_Priority
Code File Location: VisualSim/actor/lib/Resource_FCFS_Priority
Note: If you have purchased the Smart_Resource package, use the Smart_Timed_Resource block and not this one.
o TimedQueue is used in place of a Queue when the processing duration can be calculated before the transaction enters the block.
o Queues need to be reordered based on priority. If no priority is required, use TimedQueue.
o Define hardware or software resources as a queuing entity with a known timed delay.
o Example of applications include processor, bus transactions or memory requests.
o It is used to order transactions/data structure that have variable delays.
This TimedQueue (First-Come, First-Server) block contains one set of Queue + Server Resource. Each incoming Data Structure is first placed in the Queue. The Queue is ordered based on the priority of the data structure. Higher priority items will move to the front of the queue. Higher the number, higher the priority. The Server Resource is a timed resource that delays the incoming data structure before placing it on the output port.
When the Server Resource is free, the token or Data Structure at the head of the queue is sent to the server resourcee. The server resource holds the token for the time_input period and then places it on the output port. If the queue is full, then the incoming Data Structure or token is sent to the reject_output port. The input, time_input and priority_input must arrive for the transaction to be placed in the queue.
To compute the throughput through this block, multiply the utilization by the Speed used to compute the Server Resource delay.
To illustrate the usage, look at the following Examples in the BDE.
Statistics Output |
Value |
Explanation |
Mathematical Equation |
Type |
Number_Entered |
100 |
Number of transactions entering the queue. |
- |
int |
Number_Exited |
25 |
Number of transactions that left the queue. |
- |
int |
Number_Rejected |
10 |
Number of transactions rejected and output to reject port. |
- |
int |
Queue_Number |
1 |
Queue Number. Value will be 1. |
- |
int |
Occupancy_Min |
4.0 |
Minimum queue size during the simulation. |
// Obtain Min for X, where X0 = Double.MAX_VALUE if (Xn < Xn – 1) Xmin = Xn |
double |
Occupancy_Mean |
8.0 |
Mean/Average queue size during the simulation. |
// Obtain Mean for X Xµ = (1 / n) * (X1 + X2 + … + Xn) |
double |
Occupancy_StDev |
3.0 |
Standard Deviation from the Mean queue size during the simulation. |
// Obtain Standard Deviation for X |
double |
Occupancy_Max |
25.0 |
Maximum queue size consumed during the simulation. |
// Obtain Max for X, where X0 = Double.MIN_VALUE if (Xn > Xn – 1) Xmax = Xn |
double |
Total_Delay_Min |
1.3 |
In seconds. Least time through the queue+server among all transactions. |
// Obtain Min for X, where X0 = Double.MAX_VALUE if (Xn < Xn – 1) Xmin = Xn |
double |
Total_Delay_Mean |
1.3 |
In seconds. Mean/Average time through the queue+server among all transactions. |
// Obtain Mean for X Xµ = (1 / n) * (X1 + X2 + … + Xn) |
double |
Total_Delay_StDev |
1.3 |
In seconds. Standard Deviation from the Mean time through the queue+server among all transactions. |
// Obtain Standard Deviation for X |
double |
Total_Delay_Max |
1.3 |
In seconds. Maximum time through the queue+server among all transactions. |
// Obtain Max for X, where X0 = Double.MIN_VALUE if (Xn > Xn – 1) Xmax = Xn |
double |
Utilization_Pct_Mean |
0.0 |
Mean/Average utilization of the server portion only. Queue utilization not considered. Units are in percentage. |
// Obtain Mean for X Xµ = (1 / n) * (X1 + X2 + … + Xn) |
double |
Where n is the number of samples and X is occupancy or delay.
Parameter |
Explanation |
Type |
Example |
Max_FCFS_Length |
This is the maximum FCFS Queue length for every resource dimensions, or resource queues. The "Max_FCFS_Length" parameter attribute is set to 30, as a default. |
Integer |
30 |
FCFS_Type |
FCFS Queue type attribute, either "FIFO," or "LIFO." The default is "FIFO." This is the ordering of the tokens in the queue, either First-In, First-Out or Last-In, Last-Out. |
- |
FIFO |
Port |
Explanation |
FCFS_input |
This is used for data tokens entering FCFS Queue. In order for the data token or data structure to enter the queue properly, the 'FCFS_input', 'time_input' and 'priority_input' must all be entered at the same time, else port data could be overwritten. FCFS_input must arrive for the transaction to be placed in the queue. |
time_input |
This is used for setting the time delay of the incoming data token (numerical) or composite data structure (StringToken). In order for the data token or data structure to enter the queue properly, the 'FCFS_input', 'time_input' and 'priority_input' must all be entered at the same time, else port data could be overwritten. time_input must arrive for the transaction to be placed in the queue. |
priority_input |
This is used for setting the priority of the incoming data token (numerical) or composite data structure (StringToken). In order for the data token or data structure to enter the queue properly, the 'FCFS_input', 'time_input' and 'priority_input' must all be entered at the same time, else port data could be overwritten. priority_input must arrive for the transaction to be placed in the queue. |
stats_input |
This triggers the statistics output on stats_output. The statistics can be cleared by (-1), or generated by (1). |
FCFS_output |
Output port sending front FCFS data token (numerical) or composite data structure (StringToken) after a delay at the front of the queue based on 'time_input'. The ordering in the queue is based on the 'priority_input'. Output is dependent on the simulation time and 'time_input'. The takes the type of the FCFS_input. |
FCFS_length_output |
Output port sending the length of the FCFS Queue. This is generated everytime a Data Structure exits the block or departs on the output port. |
FCFS_reject_output |
Output port rejecting input FCFS Queue token when FCFS Queue is full, based on "FCFS_input". The type is based on the input token. |
stats_output |
Output port sending FCFS Queue statistics based on the trigger at the stats_input port. |
Created with the Personal Edition of HelpNDoc: Produce electronic books easily