Interfaces and Buses / Networking / Modal_List
Block Name: Model_List
- public class Model_List
- extends TypedAtomicActor
- Model_List is a general purpose database or lookup table. The block contains functionality to Add, Remove and Lookup of elements in the list. These functions can be done using multiple instances of the same block connected by the 'Model_List_Name' parameter. The data can be entered via one block (List_Add, or List_Add_DS), accessed via another block using List_Lookup, or removed by another block using List_Remove. This database contains four indices- two integers and two strings. The entire table is indexed based on any combination of these four fields. The index parameters reference field of the incoming data structures or values (string or integer) (Add, Remove or Lookup). The user can specify the two "Name" fields in the parameter window as a Data Structure Field Names (DS String Token at input), "String" (String Token at input), String Name of Model_List Lookup (fixed), or "None". The user can specify the two "Index" or "ID" fields in the parameter window as a Data Structure Field Name (DS String Token at input), "Integer" (Integer Token at input), Integer of Model_List Lookup (fixed), or "None". The string name or Integer of the Model_List refers to a specific column in the list.
- To insure proper model operation, no two Model_List entries can have the same four key values (List_Name, List_Name_ID, List_Index_Name, List_Index_Name_ID). Upon execution of List_Add_Fields or List_Add_DS, if a duplicate entry is detected, then the input Data Structure will appear at the exception output. If two Model_List entries existed with the same four key values, then model execution would select the first entry, and potentially cause an incorrect model action as a result, which would be very difficult to isolate in a simulation. Upon execution of List_Lookup, or List_Remove, if no entry is detected, then the input Data Structure will appear at the exception output.
This block can be used in conjunction with the Task_Class data structure only. The Model_List supports the Routing Table. If a generic or user-provided data structure is to be used, then the Model_List_DS block must be used.
- One anticipated use is as a random access of an instruction list, for example.
- Data Structure for the Statistics Output
send to channel 0: "BLOCK Model_List DS_NAME List_Stats DELTA 0.0 TIME 0.0 INDEX 0 ID 1
Number_in_List int 8 Number_Entered int none Number_Exited int 0 Min_List_Occupancy double 0.0 Mean_List_Occupancy double 0.0 StDev_List_Occupancy double 0.0 Max_List_Occupancy double 0.0 Min_Delay_thru_List double 0.0 Mean_Delay_thru_List double 0.0 StDev_Delay_thru_List double 0.0 Max_Delay_thru_List double 0.0
|
- Discussion of the Statistics
- Number_in_List: Number of items in the list
Number_Entered: Number entering this List
Number_Exited: Number exiting this list
Min_List_Occupancy: Minimum statistics of the buffer occupancy
Mean_List_Occupancy: Mean statistics of the buffer occupancy
StDev_List_Occupancy: Standard Deviation statistics of the buffer occupancy
Max_List_Occupancy: Maximum statistics of the buffer occupancy
Min_Delay_thru_List: Minimum wait time through this Model_list
Mean_Delay_thru_List: Mean wait time through this Model_list
StDev_Delay_thru_List: Standard Deviation wait time through this Model_list
Max_Delay_thru_List: Maximum wait time through this Model_list
- See Also:
- ListItem
- ObjectList
- Model_List_DS
- List_Stats
-
list_input
public TypedIOPort list_input
- Input port. The Data Structure that needs to be either added, lookup, or removed from the list entries, The type is string.
stats_input
public TypedIOPort stats_input
- Input port. The input integer depends on the type of statistics that is to be generated: clearing statistics (-1), getting statistics (0) on stats_output port and (1) a copy of the model list content. The type is integer.
list_output
public TypedIOPort list_output
- Output port. The matched Data Structure in the list is sent out on this port for a DS_Lookup operation. For a DS_Add and the Remove operation, the incoming Data Structure is sent. The type is string.
list_exception
public TypedIOPort list_exception
- Output port for list exceptions. This can occur if there is a duplicate Data Structure ('List_Add_Fields' or 'List_Add_DS') or Data Structure not found ('List_Lookup' or 'List_Remove'). The requesting Data Structure or Data Token is sent out this port, if a duplicate name or not found condition occurs. The type is composite Data Structure string.
stats_output
public TypedIOPort stats_output
- Output port sending queue statistics or copy of the Model_List itself, depending on the 'stats_input'. The type is string.
Model_List_Name
public Parameter Model_List_Name
- Parameter, Model_List_Name. This name is used to link different Model_List blocks accessing a common model list. The type is string.
List_Name
public Parameter List_Name
- Parameter, List_Name. This is one of the four keys. This key field is used to access the named Model_List. Can be set to 'String' meaning the input port is looking for a string match, 'Field' meaning the name entered is a field in the incoming data structure, or 'None' meaning it is ignored as a key field in the list lookup, irregardless of the 'List_Type', see below. The type is string.
List_Name_ID
public Parameter List_Name_ID
- Parameter, List_Name_ID. This is one of the four keys. This key field is used to access the named Model_List. Can be set to 'Integer' meaning the input port is looking for an integer, 'Field' meaning the name entered is a field in the incoming data structure (integer type) or 'None' meaning it is ignored as a key field in the list lookup, irregardless of the 'List_Type', see below. The type is string.
List_Index_Name
public Parameter List_Index_Name
- Parameter, List_Index_Name. This is one of the four keys. This key field is used to access the named Model_List. Can be set to 'Integer' meaning the input port is looking for a integer, or 'Field' meaning the name entered is a field in the incoming data structure (integer type), or 'None' meaning it is ignored as a key field in the list lookup, irregardless of the 'List_Type', see below. The type is string.
List_Index_Name_ID
public Parameter List_Index_Name_ID
- Parameter, List_Index_Name_ID. This is one of the four keys. This key field is used to access the named Model_List. Can be set to 'String' meaning the input port is looking for a string, or 'Field' meaning the name entered is a field in the incoming data structure, or 'None' meaning it is ignored as a key field in the list lookup, irregardless of the 'List_Type', see below. The type is string.
List_Length
public Parameter List_Length
- Parameter, List_Length. This is the maximum number of entries in this list. The type is integer.
List_Type
public StringAttribute List_Type
- List type attribute. These are List_Add_Fields, List_Add_DS, List_Lookup and List_Remove.
- The 'List_Add_Fields' adds a ListItem_Class to the Model_List based on the four key fields with at least one valid: 'List_Name', 'List_Name_ID', 'List_Index_Name', or 'List_Index_Name_ID'.
- The 'List_Add_DS' is similar to 'List_Add_Fields, except it is expected that the incoming data structure is based on ListItem_Class, and it adds the entire data structure, as opposed to the four key fields when using 'List_Add_Fields'.
- The 'List_Lookup' finds a list entry, much like a model level database, based on the four key fields, and outputs the data structure. If a match is not made, then send message to the 'list_exception' output.
- The 'List_Remove' removes a list entry, based on the four key fields, and outputs to 'list_output'. If a match is not made, then send message to the 'list_exception' output.
- The 'List_Remove' removes the data structure, while 'List_Lookup' retains the data structure in the list. The default is "List_Add_Fields."
Created with the Personal Edition of HelpNDoc: Free help authoring environment