TimedQueue_N

Parent Previous Next

Full Library / Resource / Timed-Queue / TimedQueue_N
Block Name: TimedQueue_N

Code File Location: VisualSim/actor/lib/Resource_FCFS_N

Note:  If you have purchased the Smart_Resource package, use the Smart_Timed_Resource block and not this one.

Block Overview

  o  It is used in place of a multi-dimension queue when the duration between queuing and popping is known apriori. 

  o  Define multiple concurrent resources with pre-defined processing time.

  o  Define multi-core processors, parallel buses, dma channels, wireless channels, wired virtual channels etc.

TimedQueue_N

Description

This TimedQueue (First-Come, First-Server) block contains multiple sets of Queue + Server Resource.  The Queue to use for a data structure is identified by an integer number in the dimension_input port.  Each incoming Data Structure is first placed in the Queue. 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, and dimension_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.  Queue number start at 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

Xσ = Math.sqrt ((1 / n) * ((X1 - Xµ)2 + (X2 - Xµ)2  + … + (Xn - Xµ)2))

STDEV_90_PCT = 1.6448530004790

STDEV_95_PCT = 1.9599610823207

STDEV_99_PCT = 2.5758345145732

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

Xσ = Math.sqrt ((1 / n) * ((X1 - Xµ)2 + (X2 - Xµ)2  + … + (Xn - Xµ)2))

STDEV_90_PCT = 1.6448530004790

STDEV_95_PCT = 1.9599610823207

STDEV_99_PCT = 2.5758345145732

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

Number_of_Dimensions

This specifies the number of resource dimensions, or resource queues contained in this block.

Integer

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

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.

-



Port

Explanation

FCFS_input

The data structures enter the block through this port.  In order for the data token or data structure to enter the queue properly, the 'FCFS_input', 'dimension_input' and 'time_input' must all be entered at the same time.  

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', 'dimension_input' and 'time_input' must all be entered at the same time.

dimension_input

This is used to enter the dimensions number of the Queue to place the incoming  data tokens. In order for the data token or data structure to enter the queue properly, the 'FCFS_input', 'dimension_input' and 'time_input' must all be entered at the same time.

stats_input

The stats_output outputs the statistics, when the stats_input receives a request. If the stats_input request is a server number, then the current statistics for that server is placed on the stats_output. If the input is the negative of a server number, then statistics for the Server are reset. If the {Number_of_Dimensions + 1} is sent in, then the statistics for all the servers are sent to the stats_output. Similarly, if the negative of the {Number_of_Dimensions + 1} is sent, the statistics are reset for all the Servers. The type is data structure for the single server and is array of data structures for all server statistics.

FCFS_output

Output port sending the data structure after a delay at the front of the queue based on 'time_input'.  The type 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 enters the block or departs on the output port.

FCFS_reject_output

When the queue is full, the next arriving data structures is placed on this output port and is not queued. The type is based on the input token.

stats_output

Output port sending Queue statistics when a trigger arrives on the stats_input port. The type is data structure for the single server and is array of data structures for all server statistics.




 

Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator