Blocking Queue
A blocking queue facilitates the exchange of information between two or more entities that are experiencing processes. Note that an entity can experience one process at a time.
If the capacity is finite, then placing an item in the queue may cause the sender to block its current process. Receivers of items from the queue may block if the number of items meeting their requirements are not available at the time of the request. By default, all queues are FIFO, but their disciplines can be set by the user. Instances are intended to be used to communicate between KSLProcesses via the shared mutable state of the queue. Statistics on blocking and usage of the communication channel are automatically reported.
Parameters
the parent of the queue
the capacity of the queue, by default Int.MAX_VALUE (infinite)
the name of the queue
Types
Represents a request by an entity to receive a given amount of items from the channel that meet the criteria (predicate).
Represents a request by an entity to receive a given amount of items from the channel that meet the criteria (predicate).
Allows the next request that can be filled to be selected regardless of its location within the request queue.
The default is to select the next based on the queue discipline
Interface for defining request selection
Properties
A flag to control whether the model element reacts to after experiment actions.
A flag to control whether the model element reacts to after replication actions.
The number of available slots in the channel based on the capacity
A flag to control whether the model element reacts to before experiment actions.
A flag to control whether the model element reacts to before replication actions.
Indicates the current status of the model element for observers of ModelElement.Status
A flag to control whether the model element reacts to initialization actions
True if the channel does not contain any items
True if the channel contains items
the left traversal count for pre-order traversal of the model element tree
Returns a string representation of the model element and its child model elements. Useful for realizing the model element hierarchy.
A flag to control whether the model element participates in monte carlo actions.
Gets the number of model elements contained by this model elements.
Indicates the previous status of the model element for observers of ModelElement.Status This allows the transition to be noted by observers
The user of the BlockingQueue can supply a function that will select the next entity that is waiting to receive items from the queue's channel after new items are added to the channel.
A flag to control whether the model element reacts to end replication actions.
The queue that holds requests by entities to remove items from the channel because the channel does not have the requested amount of items that meet the desired selection criteria.
the right traversal count for pre-order traversal of the model element tree
The queue that holds entities wanting to place items in to the channel that are waiting (blocked) because there is no available capacity
The user of the BlockingQueue can supply a function that will select, after items are removed from the channel, the next entity that is blocked waiting to send items to the queue's channel because the channel was full.
The spatial model associated with this model element. By default, each model element uses its parent model element's spatial model unless changed via this property. This changes the spatial model for this model element and no others.
The time interval between TimedUpdate events. The default is zero, indicating no timed update
Specifies whether this model element participates in time update event specified by its parent
Specifies the havingPriority of this model element's timed update event.
Indicates whether the warm-up action occurred sometime during the simulation for this model element. False indicates that the warm-up action has not occurred
Specifies if this model element will be warmed up when the warmup action occurs for its parent. The warm-up flag indicates whether this model element will be warmed up when its parent warm up event/action occurs. The default value for all model elements is true. A value of true implies that the model element allows its parent's warm up event to call the warm-up action. A value of false implies that the model element does not allow its parent's warm up event to call the warm-up action. False does not necessarily mean that the model element will not be warmed up. It may, through the use of the lengthOfWarmUp property, have its own warm up event and action.
Specifies the priority of this model element's warm up event.
Functions
Cancels the timed update event for this model element.
Cancels the warm-up event for this model element.
Checks if this model element or any model element directly above this model element in the hierarchy of model elements all the way until the top Model participates in the warm-up action.
Finds the items in the channel according to the condition. Does not remove the items from the channel.
Find the first parent that has its own warm up event this guarantees that all elements below the found model element do not have their own warm-up event. A model element that has its own warm up event also opts out of the warm-up action. If the returned parent is the Model, then all are controlled by the model (unless they opt out). Elements can opt out and not have their own warm-up event. Thus, they have no warm up at all.
Fills up the supplied StringBuilder carrying a string representation of the model element and its child model elements Useful for realizing the model element hierarchy.
This method returns the planned time for the warm-up for this model element.
Fills a StringBuilder carrying the model element names in the order that they will be initialized
Checks if a warm-up event is scheduled for any model element directly above this model element in the hierarchy of model elements all the way until the top Model.
Checks if current status is the supplied status
Checks if a timed update event has been scheduled for this model element
Checks if a warm-up event has been scheduled for this model element
Returns the value of a 1 millisecond time interval in terms of the base time unit
The channel must not be empty; otherwise an IllegalStateException will occur.
Removes and terminates all the requests waiting in the queue
Removes and terminates all the entities waiting in the send queue
Attempts to remove all the supplied items from the channel. Throws an IllegalStateException if all the items are not present in the channel. Removing items from the channel triggers the entities waiting to send more items into the channel if the channel was full.
Removes the request from the queue and tells the associated entity to terminate its process. The process that was suspended because the entity's request was placed in the queue is immediately terminated.
Removes the entity from the send queue and tells the entity to terminate its process. The process that was suspended because the entity was placed in the queue is immediately terminated.
Sets the after experiment option of all model elements (children) contained by this model element.
Sets the after replication flag of all model elements (children) contained by this model element.
Sets the before experiment option of all model elements (children) contained by this model element.
Sets the before replication flag of all model elements (children) contained by this model element.
Sets the initialization option of all model elements (children) contained by this model element.
Sets the monte carlo option flag of all model elements (children) contained by this model element.
Sets the end replication option flag of all model elements (children) contained by this model element. Determines whether the replicationEnded() method will be called
Sets the timed update option flag of all model elements (children) contained by this model element.
Sets the warm-up option flag of all model elements (children) contained by this model element.