Class AbstractSimulatedResourceContainer
- java.lang.Object
-
- de.uka.ipd.sdq.simucomframework.resources.AbstractSimulatedResourceContainer
-
- Direct Known Subclasses:
SimulatedLinkingResourceContainer,SimulatedResourceContainer
public abstract class AbstractSimulatedResourceContainer extends Object
Base class for simulated resource container. A resource container corresponds to PCM resource container in such that they contain an arbitrary amount of active resources.
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMap<String,String>activeResourceProvidedInterfacesprotected HashMap<String,AbstractScheduledResource>activeResourcesprotected static org.apache.log4j.LoggerLOGGERprotected StringmyContainerIDprotected SimuComModelmyModel
-
Constructor Summary
Constructors Constructor Description AbstractSimulatedResourceContainer(SimuComModel myModel, String myContainerID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<AbstractScheduledResource>getActiveResources()Retrieves all active resources in this resource container.HashMap<String,AbstractScheduledResource>getAllActiveResources()Retrieves the HashMap with all all active resources in this resource container.List<AbstractScheduledResource>getFailedResources()Retrieves all active resources in this resource container which are currently unavailable.StringgetResourceContainerID()voidloadActiveResource(SimuComSimProcess requestingProcess, int resourceServiceID, String typeID, double demand)Demand processing of a resource demand by a given type of active resources In future versions this has to control schedulers of resource types which exist in multiple instancesvoidloadActiveResource(SimuComSimProcess requestingProcess, String typeID, double demand)Demand processing of a resource demand by a given type of active resources In future versions this has to control schedulers of resource types which exist in multiple instancesvoidloadActiveResource(SimuComSimProcess requestingProcess, String providedInterfaceID, int resourceServiceID, double demand)Demand processing of a resource demand by a given type of active resource and a resource interface operationvoidloadActiveResource(SimuComSimProcess requestingProcess, String providedInterfaceID, int resourceServiceID, Map<String,Serializable> parameterMap, double demand)Demand processing of a resource demand by a given type of active resource and a resource interface operation and additional parameters which can be used in an active resource
-
-
-
Field Detail
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER
-
myModel
protected final SimuComModel myModel
-
myContainerID
protected final String myContainerID
-
activeResources
protected HashMap<String,AbstractScheduledResource> activeResources
-
-
Constructor Detail
-
AbstractSimulatedResourceContainer
public AbstractSimulatedResourceContainer(SimuComModel myModel, String myContainerID)
-
-
Method Detail
-
loadActiveResource
public void loadActiveResource(SimuComSimProcess requestingProcess, String typeID, double demand)
Demand processing of a resource demand by a given type of active resources In future versions this has to control schedulers of resource types which exist in multiple instances- Parameters:
requestingProcess- The thread requesting the processing of a resource demandtypeID- ID of the resource type to which the demand is directed. Same as the PCM resource type IDsdemand- The demand in units processable by the resource. The resource is responsible itself for converting this demand into time spans
-
loadActiveResource
public void loadActiveResource(SimuComSimProcess requestingProcess, String providedInterfaceID, int resourceServiceID, double demand)
Demand processing of a resource demand by a given type of active resource and a resource interface operation- Parameters:
requestingProcess- The thread requesting the processing of a resource demandtypeID- ID of the resource provided interface to which the demand is directed.resourceServiceID- the id of the resource service to be called.demand- The demand in units processable by the resource. The resource is responsible itself for converting this demand into time spans
-
loadActiveResource
public void loadActiveResource(SimuComSimProcess requestingProcess, String providedInterfaceID, int resourceServiceID, Map<String,Serializable> parameterMap, double demand)
Demand processing of a resource demand by a given type of active resource and a resource interface operation and additional parameters which can be used in an active resource- Parameters:
requestingProcess- The thread requesting the processing of a resource demandprovidedInterfaceID- ID of the resource provided interface to which the demand is directed.resourceServiceID- the id of the resource service to be called.parameterMap- Additional Parameters usable in an active resource. Parameters represented asdemand- The demand in units processable by the resource. The resource is responsible itself for converting this demand into time spans
-
getActiveResources
public Collection<AbstractScheduledResource> getActiveResources()
Retrieves all active resources in this resource container.- Returns:
- all active resources
-
getAllActiveResources
public HashMap<String,AbstractScheduledResource> getAllActiveResources()
Retrieves the HashMap with all all active resources in this resource container.- Returns:
- all active resources
-
getFailedResources
public List<AbstractScheduledResource> getFailedResources()
Retrieves all active resources in this resource container which are currently unavailable.- Returns:
- all unavailable active resources
-
getResourceContainerID
public String getResourceContainerID()
- Returns:
- The ID of the resource container itself
-
loadActiveResource
public void loadActiveResource(SimuComSimProcess requestingProcess, int resourceServiceID, String typeID, double demand)
Demand processing of a resource demand by a given type of active resources In future versions this has to control schedulers of resource types which exist in multiple instances- Parameters:
requestingProcess- The thread requesting the processing of a resource demandresourceServiceID- the id of the resource service to be called.typeID- ID of the resource type to which the demand is directed. Same as the PCM resource type IDsdemand- The demand in units processable by the resource. The resource is responsible itself for converting this demand into time spans
-
-