Package-level declarations
Types
The default is to allocate all available from each resource until amount needed is met in the order in which the resources are listed within the list.
An allocation represents a distinct usage of a resource by an entity with an amount allocated. Entities can have multiple allocations for the same resource. An allocation is in response to separate requests for units. Multiple requests by the same entity for units of the resource result in multiple allocations (when filled). An allocation is not created until the requested amount is available.
An allocation listener is notified whenever the resource is allocated and when the resource is deallocated. This allows general actions to occur when the resource's state changes at these instances in time.
Function to determine how to allocate requirement for units across a list of resources that have sufficient available units to meet the amount needed.
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.
A CapacitySchedule represents a known set of capacity specifications that last for a duration of time.
A conveyor consists of a series of segments. A segment has a starting location (origin) and an ending location (destination) and is associated with a conveyor. The start and end of each segment represent locations along the conveyor where entities can enter and exit. A conveyor does not utilize a spatial model. The locations associated with its segments are instances of the interface IdentityIfc. Thus, movement on the conveyor is disassociated with any spatial model associated with the entity using the conveyor. Since a spatial model using instances of the LocationIfc interface and LocationIfc extends the IdentityIfc, the locations associated with segments can be the same as those associated with spatial models. If the destination of a ride request is an instance of LocationIfc then the entity's curren location property will be updated after the movement. However, if the segments are not defined by locations within a spatial model, no updating of the entity's location will take place. The modeler is responsible for making the update to the entity location, if applicable.
A conveyor request represents the holding of cells on a conveyor and acts as a "ticket" to use the conveyor. Once an entity has a conveyor request, the entity has control over the cells at the start of the segment associated with the entry location along the conveyor. After receiving a request to access the conveyor the entity can either ride on the conveyor or exit. The conveyor request blocks at the point of access until riding or exiting. The request is placed in the blocking entry state. When the entity asks to ride the conveyor then the request will be placed in the riding state. If the entity never rides the conveyor, then the request stays in the blocking entry state. The property isWaitingForEntry indicates that the conveyor request is waiting to be allowed to block the entry cell of the conveyor at its current location. Once the conveyor request is used to ride the conveyor, the isWaitingToConvey property will report false. The isBlockingEntry property will report true until the request begins riding. Once the request reaches its destination, the isBlockingExit property will be true and the request is in the blocking exit state. When the request exits the conveyor the isCompleted property is true and the request is in the completed state. Once in the completed state, the request can no longer be used for any interaction with the conveyor.
This class represents the data associated with segments of a conveyor and facilitates the specification of segments for a conveyor. See the class Conveyor for more details on how segments are used to represent a conveyor.
Returns a list of requests that can be allocated at the current time based on the amount available criteria. Each request that can be fully allocated by the amount available is returned. The list is ordered in the same order as the RequestQ. No partial filling is permitted in this default rule.
Returns the first resource that can (individually) entirely supply the requested amount. The return list will have 0 or 1 item.
This class is designed to hold entities that are waiting within a process.
KSLProcessBuilder provides the functionality for describing a process. A process is an instance of a coroutine that can be suspended and resumed. The methods of the KSLProcessBuilder are the suspending methods that are allowed within the process modeling paradigm of the KSL. The various suspend methods have an optional string name parameter to identify the name of the suspension point. While not required for basic modeling, identifying the suspension point can be useful for more advanced modeling involving the cancellation or interrupting of a process. The name can be used to determine which suspension point is suspending the process when the process has many suspension points.
The number of times the resource was seized is used to determine the ordering. The less the number the smaller. If the number of times seized is equal, then the resource with the earliest time exiting the busy state is considered smaller. That is the one furthest back in time that the busy state was exited.
The ordering is determined such that more available units "rise to the top", then by least number times seized, then by oldest time last busy
Compares the resources based on the number available
A process model facilitates the modeling of entities experiencing processes via the process view of simulation. A ProcessModel has inner classes (Entity, EntityGenerator, etc.) that can be used to describe entities and the processes that they experience. The key class is Entity, which has a function process() that uses a builder to describe the entity's process in the form of a coroutine. An entity can have many processes described that it may follow based on different modeling logic. A process model facilitates the running of a sequence of processes that are stored in an entity's processSequence property. An entity can experience only one process at a time. After completing the process, the entity will try to use its sequence to run the next process (if available). Individual processes can be activated for specific entities.
Used to exit (terminate) a currently executing ProcessCoroutine.
If the user supplies a request selection rule then this will override the default queue discipline for finding the next request from the queue.
A Resource represents a number of common units that can be allocated to entities. A resource has an initial capacity that cannot be changed during a replication. This base resource class can only be busy or idle.
A ResourcePool represents a list of Resources from which resources can be selected to fill requests made by Entities.
An allocation represents a distinct usage of a resource by an entity with an amount allocated. Entities can have multiple allocations for the same resource. An allocation is in response to separate requests for units. Multiple requests by the same entity for units of the resource result in multiple allocations (when filled). An allocation is not created until the requested amount is available.
Returns a list of resources that have enough available to meet the request. The returned list will have resources such that the total number of available units is greater than or equal to the amount of the request. If the returned list is empty, this means that there were not sufficient available resource units to fully meet the request. It is important to note that the returned list may have more units available than requested. Resource allocation rules are used to select from the returned list to specify which of the list of resources may be allocated to meet the request.
Provides for a method to select resources from a list such that the returned list will contain resources that can fully fill the amount needed or the list will be empty.
A resource is considered busy if at least 1 unit is allocated. A resource is considered idle if no units have been allocated. The capacity can be changed during a replication; however, the capacity of every replication starts at the same initial capacity.
This data class represents the origin entryLocation and destination exitLocation of a length of a segment for a conveyor. See the class Conveyor for more details on how segments are used to represent a conveyor.
The purpose of this class is to hold entities that are waiting for a signal while executing a KSLProcess. A reference to this class can be used to signal specific, any, or all the entities waiting to proceed within their process.
Because an entity that is executing a process cannot resume itself after suspending itself, we need a mechanism to allow the entity to register itself before suspending.
Functions
Filters the list such that the returned list has resources that have units available for allocation. The returned list may be empty which indicates that there are no resources in the list that have available units.
Checks if the number of available units in the list is greater than or equal to the amount needed.
Filters the supplied list such that the returned list has resources that have units available for allocation.
Returns the total number of units that are available within the resources contained in the list.
Checks if all resources in the list are available. Throws an exception if any of the resources in the list do not have available units