NetworkDatacenter (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.network.datacenter

## Class NetworkDatacenter

- java.lang.Object
- - org.cloudbus.cloudsim.core.SimEntity
  - - org.cloudbus.cloudsim.Datacenter
    - - org.cloudbus.cloudsim.network.datacenter.NetworkDatacenter

- All Implemented Interfaces:
    Cloneable

      public class NetworkDatacenter
      extends Datacenter

  NetworkDatacenter class is a Datacenter whose hostList are virtualized and networked. It contains all the information about internal network. For example, which VM is connected to Switch etc. It deals with processing of VM queries (i.e., handling of VMs) instead of processing Cloudlet-related queries. So, even though an AllocPolicy will be instantiated (in the init() method of the superclass, it will not be used, as processing of cloudlets are handled by the CloudletScheduler and processing of VirtualMachines are handled by the VmAllocationPolicy. Please refer to following publication for more details: Saurabh Kumar Garg and Rajkumar Buyya, NetworkCloudSim: Modelling Parallel Applications in Cloud Simulations, Proceedings of the 4th IEEE/ACM International Conference on Utility and Cloud Computing (UCC 2011, IEEE CS Press, USA), Melbourne, Australia, December 5-7, 2011.
  Since:
    CloudSim Toolkit 3.0
  Author:
    Saurabh Kumar Garg

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Map<Integer,Integer>` | `HostToSwitchid`
    `Map<Integer,Switch>` | `Switchlist`
    `Map<Integer,Integer>` | `VmtoHostlist`
    `Map<Integer,Integer>` | `VmToSwitchid`

    - ### Fields inherited from class org.cloudbus.cloudsim.core.SimEntity

      `FINISHED, HOLDING, RUNNABLE, WAITING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval)` Allocates a new NetworkDatacenter object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<Integer,Switch>` | `getEdgeSwitch()` Get list of all EdgeSwitches in the Datacenter network One can design similar functions for other type of switches.
    `protected void` | `processCloudletSubmit(SimEvent ev, boolean ack)` Processes a Cloudlet submission.
    `boolean` | `processVmCreateNetwork(Vm vm)` Create the VM within the NetworkDatacenter.

    - ### Methods inherited from class org.cloudbus.cloudsim.Datacenter

      `addFile, checkCloudletCompletion, contains, contains, getCharacteristics, getDebts, getHostList, getLastProcessTime, getRegionalCisName, getSchedulingInterval, getStorageList, getVmAllocationPolicy, getVmList, predictFileTransferTime, printDebts, processCloudlet, processCloudletCancel, processCloudletMove, processCloudletPause, processCloudletResume, processCloudletStatus, processDataAdd, processDataDelete, processEvent, processOtherEvent, processPingRequest, processVmCreate, processVmDestroy, processVmMigrate, registerOtherEntity, setCharacteristics, setDebts, setLastProcessTime, setRegionalCisName, setSchedulingInterval, setStorageList, setVmAllocationPolicy, setVmList, shutdownEntity, startEntity, updateCloudletProcessing`

    - ### Methods inherited from class org.cloudbus.cloudsim.core.SimEntity

      `cancelEvent, clone, getEventBuffer, getId, getName, getNextEvent, getNextEvent, getState, numEventsWaiting, numEventsWaiting, pause, run, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, scheduleNow, scheduleNow, selectEvent, send, send, send, send, sendNow, sendNow, sendNow, sendNow, setEventBuffer, setId, setState, waitForEvent`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### VmToSwitchid

          public Map<Integer,Integer> VmToSwitchid

    - #### HostToSwitchid

          public Map<Integer,Integer> HostToSwitchid

    - #### Switchlist

          public Map<Integer,Switch> Switchlist

    - #### VmtoHostlist

          public Map<Integer,Integer> VmtoHostlist

  - ### Constructor Detail

    - #### NetworkDatacenter

          public NetworkDatacenter(String name,
                           DatacenterCharacteristics characteristics,
                           VmAllocationPolicy vmAllocationPolicy,
                           List<Storage> storageList,
                           double schedulingInterval)
                            throws Exception

      Allocates a new NetworkDatacenter object.
      Parameters:
        `name` - the name to be associated with this entity (as required by Sim_entity class from simjava package)
        `characteristics` - an object of DatacenterCharacteristics
        `storageList` - a LinkedList of storage elements, for data simulation
        `vmAllocationPolicy` - the vmAllocationPolicy
      Throws:
        `Exception` - This happens when one of the following scenarios occur:
        - creating this entity before initializing CloudSim package
        - this entity name is `null` or empty
        - this entity has `zero` number of PEs (Processing Elements).
          No PEs mean the Cloudlets can't be processed. A CloudResource must contain one or more Machines. A Machine must contain one or more PEs.

  - ### Method Detail

    - #### getEdgeSwitch

          public Map<Integer,Switch> getEdgeSwitch()

      Get list of all EdgeSwitches in the Datacenter network One can design similar functions for other type of switches.

    - #### processVmCreateNetwork

          public boolean processVmCreateNetwork(Vm vm)

      Create the VM within the NetworkDatacenter. It can be directly accessed by Datacenter Broker which manage allocation of Cloudlets.

    - #### processCloudletSubmit

          protected void processCloudletSubmit(SimEvent ev,
                                   boolean ack)

      Processes a Cloudlet submission.
      Overrides:
        `processCloudletSubmit` in class `Datacenter`
      Parameters:
        `ev` - a SimEvent object
        `ack` - an acknowledgement

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.