Package jsl.modeling.elements.entity
Class SeizeResources
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.SchedulingElement
-
- jsl.modeling.elements.entity.EntityReceiver
-
- jsl.modeling.elements.entity.SeizeResources
-
- All Implemented Interfaces:
GetEntityReceiverIfc
,ObservableIfc
,GetNameIfc
,IdentityIfc
- Direct Known Subclasses:
SQSeize
public abstract class SeizeResources extends EntityReceiver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SeizeResources.AllocationListener
protected class
SeizeResources.AllocationSetListener
static class
SeizeResources.RequirementOption
NONE = no requirement specified, will result in an exception DIRECT = uses the requirements specified directly for the activity BY_TYPE = asks the EntityType to provide the requirements for this activity ENTITY = uses the entity's getRequirements() method-
Nested classes/interfaces inherited from class jsl.simulation.ModelElement
ModelElement.EventBuilderIfc<T>, ModelElement.EventScheduler<T>, ModelElement.ModelElementComparator, ModelElement.RequestBuilder, ModelElement.RequestDurationIfc, ModelElement.RequestTimeIfc, ModelElement.RequestUsingIfc, ModelElement.TimedUpdateEventAction, ModelElement.TimeUnitIfc<T>, ModelElement.WarmUpEventAction
-
-
Field Summary
Fields Modifier and Type Field Description protected SeizeResources.AllocationListener
myAllocationListener
Default allocation listener for single resource or single resource set requirementsprotected SeizeResources.RequirementOption
myReqOption
The requirement option for the seizeprotected java.util.List<SeizeRequirement>
myRequirements
A Map of requirements for this seize-
Fields inherited from class jsl.modeling.elements.entity.EntityReceiver
myComposite, myDirectEntityReceiver, myNumInReceiver, mySender, mySendOption, myTimeInReceiver
-
Fields inherited from class jsl.simulation.ModelElement
AFTER_EXPERIMENT, AFTER_REPLICATION, BEFORE_EXPERIMENT, BEFORE_REPLICATION, CONDITIONAL_ACTION_REGISTRATION, DEFAULT_TIMED_EVENT_PRIORITY, INITIALIZED, MONTE_CARLO, myAfterExperimentOption, myAfterReplicationOption, myBeforeExperimentOption, myBeforeReplicationOption, myInitializationOption, myLengthOfWarmUp, myModelElements, myMonteCarloOption, myObservableComponent, myReplicationEndedOption, myTimedUpdateActionListener, myTimedUpdateEvent, myTimedUpdateInterval, myTimedUpdateOption, myTimedUpdatePriority, myWarmUpActionListener, myWarmUpEvent, myWarmUpIndicator, myWarmUpOption, myWarmUpPriority, NONE, REMOVED_FROM_MODEL, REPLICATION_ENDED, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TIMED_UPDATE, UPDATE, WARMUP
-
-
Constructor Summary
Constructors Constructor Description SeizeResources(ModelElement parent)
SeizeResources(ModelElement parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addSeizeRequirement(Resource r)
void
addSeizeRequirement(Resource r, int amt)
void
addSeizeRequirement(Resource r, int amt, boolean partialFillFlag)
void
addSeizeRequirement(Resource r, int amt, int priority)
void
addSeizeRequirement(Resource r, int amt, int priority, boolean partialFillFlag)
void
addSeizeRequirement(ResourceSet set)
void
addSeizeRequirement(ResourceSet set, int amt)
void
addSeizeRequirement(ResourceSet set, int amt, int priority)
void
addSeizeRequirement(ResourceSet set, int amt, int priority, boolean partialFillFlag, ResourceSelectionRuleIfc rule, java.lang.String saveKey)
void
addSeizeRequirement(ResourceSet set, int amt, java.lang.String saveKey)
void
addSeizeRequirement(ResourceSet set, int amt, ResourceSelectionRuleIfc rule)
SeizeResources.RequirementOption
getSeizeRequirementOption()
protected java.util.List<SeizeRequirement>
getSeizeRequirements(Entity e)
protected abstract void
queueEntity(Entity entity)
Subclasses need to implement a mechanism to hold entities that are waiting for resourcesprotected void
receive(Entity entity)
Represents logic to correctly receive the entity and process it accordinglyprotected abstract void
removeEntity(Entity entity)
Subclasses need to implement a mechanism to remove the an entity (e.g.protected void
seizeResources(Entity entity)
protected abstract Entity
selectNextEntity()
Subclasses need to implement a mechanism to select the next entity from whatever mechanism is being used to hold the entities waiting for resources.void
setSeizeRequirementOption(SeizeResources.RequirementOption option)
protected void
startUsingResources(Entity entity)
Implements the start of using the resources by removing the entity and starting the activity-
Methods inherited from class jsl.modeling.elements.entity.EntityReceiver
getComposite, getDirectEntityReceiver, getEntityReceiver, isPartOfComposite, sendEntity, setComposite, setDirectEntityReceiver, setDirectEntityReceiver, setEntitySender, setSendingOption, turnOnNumberInReceiverCollection, turnOnTimeInReceiverCollection
-
Methods inherited from class jsl.simulation.SchedulingElement
cancelEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent
-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication, afterReplication_, asString, beforeExperiment, beforeExperiment_, beforeReplication, beforeReplication_, buildEventGenerator, cancelTimedUpdateEvent, cancelWarmUpEvent, changeParentModelElement, checkForAfterExperiment, checkForAfterReplication, checkForBeforeExperiment, checkForBeforeReplication, checkForConditionalActionRegistration, checkForInitialize, checkForMonteCarlo, checkForRemoveFromModel, checkForReplicationEnded, checkForTimedUpdate, checkForUpdate, checkForWarmUp, checkObserverState, checkWarmUpOption, clearModelElementObservers, contains, countObservers, createEntity, createEntity, createQObject, day, deleteObserver, deleteObserverFromModelElements, deleteObservers, findModelElementWithWarmUpEvent, getAfterExperimentOption, getAfterReplicationOption, getAllCounters, getAllModelElements, getAllRandomElements, getAllResponseVariables, getAllVariables, getBeforeExperimentOption, getBeforeReplicationOption, getChildModelElementIterator, getCurrentReplicationNumber, getDefaultEntityType, getExecutive, getExperiment, getId, getInitializationOption, getInitializationOrderAsString, getLeftPreOrderTraversalCount, getLengthOfWarmUp, getModel, getModelElementCompartor, getModelElementsAsString, getModelElementsAsString, getModelElementsAsString, getMonteCarloOption, getName, getNumberOfModelElements, getObserverState, getParentModelElement, getPreviousObserverState, getReplicationEndedOption, getRightPreOrderTraversalCount, getSimulation, getSpatialModel, getStringLabel, getThisElementsCounters, getThisElementsModelElements, getThisElementsRandomVariables, getThisElementsResponseVariables, getThisElementsVariables, getTime, getTimedUpdateInterval, getTimedUpdateOption, getUpdateNotificationFlag, getVariable, getWarmUpEventTime, getWarmUpOption, hour, indent, initialize, initialize_, isTimedUpdateEventScheduled, isWarmedUp, isWarmUpEventScheduled, isWarmUpScheduled, millisecond, minute, montecarlo, montecarlo_, notifyAfterExperimentObservers, notifyAfterReplicationObservers, notifyBeforeExperimentObservers, notifyBeforeReplicationObservers, notifyConditionalActionRegistrationObservers, notifyInitializationObservers, notifyMonteCarloObservers, notifyObservers, notifyObservers, notifyRemovingFromModelObservers, notifyReplicationEndedObservers, notifyTimedUpdateObservers, notifyUpdateObservers, notifyWarmUpObservers, registerConditionalActions, registerConditionalActions_, removedFromModel, removeFromModel, replicationEnded, replicationEnded_, schedule, second, seize, setAfterExperimentOption, setAfterExperimentOptionForModelElements, setAfterReplicationOption, setAfterReplicationOptionForModelElements, setBeforeExperimentOption, setBeforeExperimentOptionForModelElements, setBeforeReplicationOption, setBeforeReplicationOptionForModelElements, setInitializationOption, setInitializationOptionForModelElements, setLengthOfWarmUp, setModel, setMonteCarloOption, setMonteCarloOptionForModelElements, setName, setObserverState, setParentModelElement, setReplicationEndedOption, setReplicationEndedOptionForModelElements, setSpatialModel, setStringLabel, setTimedUpdateInterval, setTimedUpdateOption, setTimedUpdateOptionForModelElements, setUpdateNotificationFlag, setWarmUpOption, setWarmUpOptionForModelElements, stopExecutive, stopExecutive, timedUpdate, timedUpdate_, toString, update, useControls, warmUp, warmUp_, week
-
-
-
-
Field Detail
-
myReqOption
protected SeizeResources.RequirementOption myReqOption
The requirement option for the seize
-
myRequirements
protected java.util.List<SeizeRequirement> myRequirements
A Map of requirements for this seize
-
myAllocationListener
protected SeizeResources.AllocationListener myAllocationListener
Default allocation listener for single resource or single resource set requirements
-
-
Constructor Detail
-
SeizeResources
public SeizeResources(ModelElement parent)
-
SeizeResources
public SeizeResources(ModelElement parent, java.lang.String name)
-
-
Method Detail
-
queueEntity
protected abstract void queueEntity(Entity entity)
Subclasses need to implement a mechanism to hold entities that are waiting for resources- Parameters:
entity
-
-
selectNextEntity
protected abstract Entity selectNextEntity()
Subclasses need to implement a mechanism to select the next entity from whatever mechanism is being used to hold the entities waiting for resources. The entity should not be removed from the underlying holding mechanism. If null is returned, then no entities can be selected- Returns:
-
removeEntity
protected abstract void removeEntity(Entity entity)
Subclasses need to implement a mechanism to remove the an entity (e.g. selectNextEntity()) from whatever mechanism being used to hold the entities waiting for resources.- Parameters:
entity
- the entity to be removed
-
receive
protected void receive(Entity entity)
Description copied from class:EntityReceiver
Represents logic to correctly receive the entity and process it accordingly- Specified by:
receive
in classEntityReceiver
-
seizeResources
protected void seizeResources(Entity entity)
-
startUsingResources
protected void startUsingResources(Entity entity)
Implements the start of using the resources by removing the entity and starting the activity- Parameters:
entity
-
-
getSeizeRequirements
protected java.util.List<SeizeRequirement> getSeizeRequirements(Entity e)
-
addSeizeRequirement
public void addSeizeRequirement(Resource r)
-
addSeizeRequirement
public void addSeizeRequirement(Resource r, int amt)
-
addSeizeRequirement
public void addSeizeRequirement(Resource r, int amt, boolean partialFillFlag)
-
addSeizeRequirement
public void addSeizeRequirement(Resource r, int amt, int priority)
-
addSeizeRequirement
public void addSeizeRequirement(Resource r, int amt, int priority, boolean partialFillFlag)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set, int amt)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set, int amt, ResourceSelectionRuleIfc rule)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set, int amt, java.lang.String saveKey)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set, int amt, int priority)
-
addSeizeRequirement
public void addSeizeRequirement(ResourceSet set, int amt, int priority, boolean partialFillFlag, ResourceSelectionRuleIfc rule, java.lang.String saveKey)
-
getSeizeRequirementOption
public SeizeResources.RequirementOption getSeizeRequirementOption()
-
setSeizeRequirementOption
public void setSeizeRequirementOption(SeizeResources.RequirementOption option)
-
-