Switch (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.network.datacenter

## Class Switch

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

- All Implemented Interfaces:
    Cloneable
  Direct Known Subclasses:
    AggregateSwitch, EdgeSwitch, RootSwitch

      public class Switch
      extends SimEntity

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `List<Vm>` | `BagofTaskVm`
    `int` | `datacenterid`
    `NetworkDatacenter` | `dc`
    `double` | `downlinkbandwidth`
    `List<Switch>` | `downlinkswitches`
    `Map<Integer,List<NetworkPacket>>` | `downlinkswitchpktlist`
    `SortedMap<Double,List<NetworkHost>>` | `fintimelistHost`
    `SortedMap<Double,List<NetworkVm>>` | `fintimelistVM`
    `Map<Integer,NetworkHost>` | `hostlist`
    `int` | `id`
    `double` | `latency`
    `int` | `level`
    `double` | `numport`
    `Map<Integer,List<NetworkPacket>>` | `packetTohost`
    `ArrayList<NetworkPacket>` | `pktlist`
    `double` | `switching_delay`
    `double` | `uplinkbandwidth`
    `List<Switch>` | `uplinkswitches`
    `Map<Integer,List<NetworkPacket>>` | `uplinkswitchpktlist`
    `Map<Integer,NetworkVm>` | `Vmlist`

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

      `FINISHED, HOLDING, RUNNABLE, WAITING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Switch(String name, int level, NetworkDatacenter dc)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected List<NetworkHost>` | `getfreehostlist(int numhost)`
    `protected List<NetworkVm>` | `getfreeVmlist(int numVMReq)`
    `protected NetworkHost` | `getHostwithVM(int vmid)`
    `void` | `processEvent(SimEvent ev)` This method is invoked by the `Simulation` class whenever there is an event in the deferred queue, which needs to be processed by the entity.
    `protected void` | `processhostpacket(SimEvent ev)`
    `protected void` | `processpacket_down(SimEvent ev)`
    `protected void` | `processpacket_up(SimEvent ev)`
    `protected void` | `processpacket(SimEvent ev)`
    `protected void` | `processpacketforward(SimEvent ev)`
    `void` | `shutdownEntity()` This method is invoked by the `Simulation` before the simulation finishes.
    `void` | `startEntity()` This method is invoked by the `Simulation` class when the simulation is started.

    - ### 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

    - #### id

          public int id

    - #### level

          public int level

    - #### datacenterid

          public int datacenterid

    - #### uplinkswitchpktlist

          public Map<Integer,List<NetworkPacket>> uplinkswitchpktlist

    - #### downlinkswitchpktlist

          public Map<Integer,List<NetworkPacket>> downlinkswitchpktlist

    - #### hostlist

          public Map<Integer,NetworkHost> hostlist

    - #### uplinkswitches

          public List<Switch> uplinkswitches

    - #### downlinkswitches

          public List<Switch> downlinkswitches

    - #### packetTohost

          public Map<Integer,List<NetworkPacket>> packetTohost

    - #### uplinkbandwidth

          public double uplinkbandwidth

    - #### downlinkbandwidth

          public double downlinkbandwidth

    - #### latency

          public double latency

    - #### numport

          public double numport

    - #### dc

          public NetworkDatacenter dc

    - #### fintimelistHost

          public SortedMap<Double,List<NetworkHost>> fintimelistHost

    - #### fintimelistVM

          public SortedMap<Double,List<NetworkVm>> fintimelistVM

    - #### pktlist

          public ArrayList<NetworkPacket> pktlist

    - #### BagofTaskVm

          public List<Vm> BagofTaskVm

    - #### switching_delay

          public double switching_delay

    - #### Vmlist

          public Map<Integer,NetworkVm> Vmlist

  - ### Constructor Detail

    - #### Switch

          public Switch(String name,
                int level,
                NetworkDatacenter dc)

  - ### Method Detail

    - #### startEntity

          public void startEntity()

      Description copied from class: `SimEntity`
      This method is invoked by the `Simulation` class when the simulation is started. This method should be responsible for starting the entity up.
      Specified by:
        `startEntity` in class `SimEntity`

    - #### processEvent

          public void processEvent(SimEvent ev)

      Description copied from class: `SimEntity`
      This method is invoked by the `Simulation` class whenever there is an event in the deferred queue, which needs to be processed by the entity.
      Specified by:
        `processEvent` in class `SimEntity`
      Parameters:
        `ev` - the event to be processed by the entity

    - #### processhostpacket

          protected void processhostpacket(SimEvent ev)

    - #### processpacket_down

          protected void processpacket_down(SimEvent ev)

    - #### processpacket_up

          protected void processpacket_up(SimEvent ev)

    - #### processpacket

          protected void processpacket(SimEvent ev)

    - #### processpacketforward

          protected void processpacketforward(SimEvent ev)

    - #### getHostwithVM

          protected NetworkHost getHostwithVM(int vmid)

    - #### getfreeVmlist

          protected List<NetworkVm> getfreeVmlist(int numVMReq)

    - #### getfreehostlist

          protected List<NetworkHost> getfreehostlist(int numhost)

    - #### shutdownEntity

          public void shutdownEntity()

      Description copied from class: `SimEntity`
      This method is invoked by the `Simulation` before the simulation finishes. If you want to save data in log files this is the method in which the corresponding code would be placed.
      Specified by:
        `shutdownEntity` in class `SimEntity`

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