Resource
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 resource is busy if at least 1 unit has been allocated. A resource becomes busy when it has allocations. If a seize-request occurs and the resource has capacity to fill it completely, then the request is allocated the requested amount. If insufficient capacity is available at the time of the request, then the request waits until the requested units can be allocated.
If b(t) is the number of units allocated at time t, and c(t) is the current capacity of the resource, then the number of available units, a(t), is defined as a(t) = c(t) - b(t). Thus, a resource is idle if a(t) = c(t). Since a resource is busy if b(t) 0, busy and idle are complements of each other. A resource is either busy b(t) 0 or idle b(t) = 0. If a(t) 0, then the resource has units that can be allocated.
The utilization of a resource is defined as the ratio of the average number of busy units to the average number of active units. Units are active if they are part of the current capacity of the resource.
Subclasses of Resource implement additional state behavior.
Parameters
the parent holding this resource
the name of the resource
the initial capacity of the resource. Cannot be changed during a replication. The default capacity is 1.
Inheritors
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.
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.
Access to the busy state. Busy means at least 1 unit of the resource is allocated.
Indicates the current status of the model element for observers of ModelElement.Status
Returns the default reporting option. True means that the response should appear on the default reports
If a(t) is greater than zero
If b(t) is greater than zero
Access to the idle state. Idle means that no units of the resource are allocated.
Access to the inactive state. Inactive means that the capacity of the resource is 0
The initial capacity of the resource at the start of the replication. The initial capacity must be greater than 0.
A flag to control whether the model element reacts to initialization actions
If b(t) is the number of busy units, and c(t) is the current capacity, then the instantaneous utilization iu(t) is
Checks to see if the resource is inactive
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.
If c(t) is the current capacity and b(t) is the current number busy, then a(t) = c(t) - b(t) is the current number of available units. Under some capacity change situations, a(t) may be negative.
Gets the number of model elements contained by this model elements.
Statistical response representing the number of busy units of the resource.
The number of times that the resource has been released (deallocated)
The number of times that the resource has been seized (allocated)
The last (previous) state before the current state.
Indicates the previous status of the model element for observers of ModelElement.Status This allows the transition to be noted by observers
A flag to control whether the model element reacts to end replication actions.
the right traversal count for pre-order traversal of the model element tree
Statistical response representing the utilization of the resource. This is the time average number of busy units divided by the time average capacity.
The number of times the resource was seized
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.
Time when state time accumulation started. May be greater than 0 because of warmup.
The current state of the resource.
Indicates if proportion of time spent in states (idle, busy, inactive) is automatically reported
time average instantaneous utilization
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.
Total time that the resource has been idle, busy, or inactive
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
Cause the entity to start the process. The activation of the process is governed by an event that is scheduled to occur at the specified activation time.
Add an allocation listener. Allocation listeners are notified when (after) units are allocated to an entity and after units are deallocated.
It is an error to attempt to allocate resource units to an entity if there are insufficient units available. Thus, the amount requested must be less than or equal to the number of units available at the time of this call.
A resource may fill a request in many ways. This function indicates if the request for the amount needed can be allocated immediately, without any wait based on the current state of the resource. Since the underlying state of the resource may be more complex than indicated by the state exposed in the API, it is important to use this method to determine if the requested amount can be allocated.
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.
Causes the resource to deallocate the amount associated with the allocation
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 the entity is using (has allocated units) of the resource.
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
Computes the number of different allocations of the resource held by the entity. Recall that allocations can be for different amounts.
Removes the listener
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.
Cause the entity to start the process sequence in the order specified by the sequence. The activation of the first process is governed by an event that is scheduled to occur based on the time until activation parameter.
Cause the entity to start the process sequence in the order specified by the sequence. The activation of the first process is governed by an event that is scheduled to occur at the specified activation time.
Computes the total number of units of the specified resource that are allocated to the entity.