Quantity-Shared

Modeling consumption of quantity which can be memory addresses, semaphore pool and slots avaialable in a parking garage

Using_QS_Queues

Browsable image of the model.

  • For an executable version,
  • Mouse over the icons to view parameters. Click on hierarchy and plotters to reveal content (if provided).
  • To simulate, click on Launch button, open downloaded file and click Run on the Java Security Page.
Using_QS_Queuesmodel <h2>TextDisplay</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>rowsDisplayed</td><td>10</td><td>10</td></tr><tr><td>columnsDisplayed</td><td>40</td><td>40</td></tr><tr><td>suppressBlankLines</td><td>false</td><td>false</td></tr><tr><td>title</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>ViewText</td><td>true</td><td>true</td></tr><tr><td>saveText</td><td>false</td><td>false</td></tr><tr><td>fileName</td><td>Enter Filename to save text</td><td>&quot;Enter Filename to save text&quot;</td></tr><tr><td>Append_Time</td><td>true</td><td>true</td></tr></table> <h2>ResourceStatistics</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Resource_List</td><td>{&quot;MyResourceAllocate&quot;,&quot;MyResourceAllocatePriority&quot;} /* Names of Resources */</td><td>{&quot;MyResourceAllocate&quot;, &quot;MyResourceAllocatePriority&quot;}</td></tr><tr><td>ResourceLength_List</td><td>{Number_of_Queues+1,Number_of_Queues+1} /* Length of all Resources in the Resource_List */</td><td>{6, 6}</td></tr><tr><td>Number_of_Samples</td><td>1 /* Number of output or reset in a simulation run */</td><td>1</td></tr><tr><td>Statistics</td><td>true /* True to generate; False to reset */</td><td>true</td></tr></table> <h2>ExpressionList2</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Expression_List</td><td>input.QName = &quot;Queue3&quot;\\ninput.Quantity = irand (1, Max_Quantity)\\ninput.QNum = irand (1, (Number_of_Queues-1))</td><td>input.QName = &quot;Queue3&quot;\\ninput.Quantity = irand (1, Max_Quantity)\\ninput.QNum = irand (1, (Number_of_Queues-1))</td></tr><tr><td>Output_Ports</td><td>output,Quantity,Queue_Num</td><td>&quot;output,Quantity,Queue_Num&quot;</td></tr><tr><td>Output_Values</td><td>input,input.Quantity,input.QNum</td><td>&quot;input,input.Quantity,input.QNum&quot;</td></tr><tr><td>Output_Conditions</td><td>true,true,true</td><td>&quot;true,true,true&quot;</td></tr></table> <h2>ExpressionList</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Expression_List</td><td>input.QName = &quot;Queue4&quot;\\ninput.Priority = irand (1, Highest_Priority)\\ninput.Quantity = irand (1, Max_Quantity)\\ninput.QNum = irand (1, (Number_of_Queues-1))</td><td>input.QName = &quot;Queue4&quot;\\ninput.Priority = irand (1, Highest_Priority)\\ninput.Quantity = irand (1, Max_Quantity)\\ninput.QNum = irand (1, (Number_of_Queues-1))</td></tr><tr><td>Output_Ports</td><td>output,Quantity,Priority,Queue_Num</td><td>&quot;output,Quantity,Priority,Queue_Num&quot;</td></tr><tr><td>Output_Values</td><td>input,input.Quantity,input.Priority,input.QNum</td><td>&quot;input,input.Quantity,input.Priority,input.QNum&quot;</td></tr><tr><td>Output_Conditions</td><td>true,true,true,true</td><td>&quot;true,true,true,true&quot;</td></tr></table> <h2>Traffic</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Data_Structure_Name</td><td>&quot;Header&quot;</td><td>&quot;Header&quot;</td></tr><tr><td>Start_Time</td><td>0.2</td><td>0.2</td></tr><tr><td>Value_1</td><td>Input_Rate</td><td>1.0</td></tr><tr><td>Value_2</td><td>2.0</td><td>2.0</td></tr><tr><td>Random_Seed</td><td>123457L</td><td>123457L</td></tr><tr><td>Time_Distribution</td><td>Fixed (Value_1)</td><td>Fixed (Value_1)</td></tr></table> <h2>Delay2</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Delay_Value</td><td>rand (1.0,Task_Time)</td><td>&quot;rand (1.0,Task_Time)&quot;</td></tr></table> <h2>Resource_QS_Free2</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr></table> <h2>Delay</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Delay_Value</td><td>rand (1.0,Task_Time)</td><td>&quot;rand (1.0,Task_Time)&quot;</td></tr></table> <h2>Resource_QS_Free</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr></table> <h2>Resource_QS_Allocate_Priority</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Block_Name</td><td>&quot;MyResourceAllocatePriority&quot;</td><td>&quot;MyResourceAllocatePriority&quot;</td></tr><tr><td>Resource_Capacity</td><td>60</td><td>60</td></tr><tr><td>Max_Queue_Occupancy</td><td>30</td><td>30</td></tr><tr><td>Number_of_Dimensions</td><td>Number_of_Queues</td><td>5</td></tr><tr><td>Blocking_Mechanism</td><td>Wait_for_Resource</td><td>Wait_for_Resource</td></tr><tr><td>Queueing_Disipline</td><td>FIFO</td><td>FIFO</td></tr><tr><td>Addressing_Mode</td><td>Non_Indexed</td><td>Non_Indexed</td></tr><tr><td>Queue_Reject_Mechanism</td><td>Incoming_DS_Rejected</td><td>Incoming_DS_Rejected</td></tr></table> <h2>Resource_QS_Allocate</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Block_Name</td><td>&quot;MyResourceAllocate&quot;</td><td>&quot;MyResourceAllocate&quot;</td></tr><tr><td>Resource_Capacity</td><td>100</td><td>100</td></tr><tr><td>Max_Queue_Occupancy</td><td>30</td><td>30</td></tr><tr><td>Number_of_Dimensions</td><td>Number_of_Queues</td><td>5</td></tr><tr><td>Blocking_Mechanism</td><td>Wait_for_Resource</td><td>Wait_for_Resource</td></tr><tr><td>Queueing_Disipline</td><td>FIFO</td><td>FIFO</td></tr><tr><td>Addressing_Mode</td><td>Non_Indexed</td><td>Non_Indexed</td></tr></table> <h2>xTime_yData_Plotter</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>fillOnWrapup</td><td>true</td><td>true</td></tr><tr><td>legend</td><td>Queue1,Queue2</td><td>Queue1,Queue2</td></tr><tr><td>startingDataset</td><td>0</td><td>0</td></tr><tr><td>fileName</td><td>Enter Filename to save plot</td><td>&quot;Enter Filename to save plot&quot;</td></tr><tr><td>viewPlot</td><td>true</td><td>true</td></tr><tr><td>savePlot</td><td>false</td><td>false</td></tr></table> <h2>Decision3</h2><table border="1"><tr><td><b>Parameter</b></td><td><b>Expression</b></td><td><b>Value</b></td></tr><tr><td>Block_Documentation</td><td>Enter User Documentation Here</td><td>Enter User Documentation Here</td></tr><tr><td>Expression_List</td><td>\\n</td><td>\\n</td></tr><tr><td>Output_Ports</td><td>output,output2</td><td>&quot;output,output2&quot;</td></tr><tr><td>Output_Values</td><td>input.ID,input.ID</td><td>&quot;input.ID,input.ID&quot;</td></tr><tr><td>Output_Conditions</td><td>(input.QName==&quot;Queue3&quot;),(input.QName==&quot;Queue4&quot;)</td><td>&quot;(input.QName==&quot;Queue3&quot;),(input.QName==&quot;Queue4&quot;)&quot;</td></tr></table>

This shows the usage of the Quantity-Shared blocks- with and without priority. These consist of three blocks- one to allocate the quanity, one to allocate the quantity with priority for queue reordering and a third block that releases the quantity.

This is similar to the Server, in that, this takes in a quantity instead of the time. It is similar to the Queue, in that, it requires a Pop to return the quantity back to the pool.

This represents a discrete quantity of resources (Parking slots, memory array, battery charge or cache words) that are available in a resource pool. When a request comes in, the transaction is allocated quantity, based on the amount available in the pool. The allocated is returned to the queue at some future times. The time between the allocation and release is the processing time. The resources can be tied to a specific index location, first available or get the minimum available.