Class ResourceRegistry


  • public class ResourceRegistry
    extends Object
    Central registry for simulated resources (resource containers, linking resources). The central registry can be used to start and stop all resources simultaniously.
    • Constructor Detail

      • ResourceRegistry

        public ResourceRegistry​(SimuComModel model)
        Default initialization.
        Parameters:
        model - the corresponding SimuCom model.
    • Method Detail

      • addResourceContainer

        public void addResourceContainer​(SimulatedResourceContainer container)
        Add a PCM ResourceContainer
        Parameters:
        container - the resource container to add
      • createResourceContainer

        public AbstractSimulatedResourceContainer createResourceContainer​(String containerID)
        Create and add a PCM ResourceContainer
        Parameters:
        containerID - PCM ID of the resource container to create
        Returns:
        The simulated resource container object
      • createLinkingResourceContainer

        public AbstractSimulatedResourceContainer createLinkingResourceContainer​(String containerID)
        Create a simulated PCM LinkingResource
        Parameters:
        containerID - PCM ID of the LinkingResource
        Returns:
        The resource container introduced for the linking resource. Note, this container is virtual as it does not exist in the PCMs original model. However, it exists in the simulation to unify resource container and link resource behavior.
      • addLinkingResourceContainer

        public void addLinkingResourceContainer​(SimulatedLinkingResourceContainer container)
        Add a PCM LinkingResourceContainer
        Parameters:
        container - the linking resource container to add
      • containsResourceContainer

        public boolean containsResourceContainer​(String resourceContainerID)
        Parameters:
        resourceContainerID - ID of the container
        Returns:
        True if the given ID is known in the resource registry
      • getResourceContainer

        public AbstractSimulatedResourceContainer getResourceContainer​(String resourceContainerID)
        Retrieve the resource container with the given ID
        Parameters:
        resourceContainerID - ID of the container to retrieve. The container must exist in this registry
        Returns:
        The queried resource container
      • removeResourceContainerFromRegistry

        public AbstractSimulatedResourceContainer removeResourceContainerFromRegistry​(String resourceContainerID)
        Retrieve the resource container with the given ID
        Parameters:
        resourceContainerID - ID of the container to retrieve. The container must exist in this registry
        Returns:
        The queried resource container
      • activateAllActiveResources

        public void activateAllActiveResources()
        Start all simulated resources in the simulation framework
      • deactivateAllActiveResources

        public void deactivateAllActiveResources()
        Stop all resources in the simulation framework
      • deactivateAllPassiveResources

        public void deactivateAllPassiveResources()