cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java
protected void createNetwork(NetworkDatacenter datacenter) {
        EdgeSwitch[] edgeSwitches = new EdgeSwitch[1];
        for (int i = 0; i < edgeSwitches.length; i++) {
            edgeSwitches[i] = new EdgeSwitch(simulation, datacenter);
            datacenter.addSwitch(edgeSwitches[i]);
        }

        for (NetworkHost host : datacenter.<NetworkHost>getHostList()) {
            int switchNum = host.getId() / edgeSwitches[0].getPorts();
            edgeSwitches[switchNum].connectHost(host);
            host.setEdgeSwitch(edgeSwitches[switchNum]);
        }
    }
/**
     * Creates internal Datacenter network.
     * @param datacenter Datacenter where the network will be created
     */
Creates internal Datacenter network.
@param datacenter Datacenter where the network will be created
Creates internal Datacenter network . @param datacenter Datacenter where the network will be created
protected void createNetwork(NetworkDatacenter datacenter) {
        EdgeSwitch[] edgeSwitches = new EdgeSwitch[1];
        for (int i = 0; i < edgeSwitches.length; i++) {
            edgeSwitches[i] = new EdgeSwitch(simulation, datacenter);
            datacenter.addSwitch(edgeSwitches[i]);
        }
        for (NetworkHost host : datacenter.<NetworkHost>getHostList()) {
            int switchNum = host.getId() / edgeSwitches[0].getPorts();
            edgeSwitches[switchNum].connectHost(host);
            host.setEdgeSwitch(edgeSwitches[switchNum]);
        }
    }
protected void createNetwork ( NetworkDatacenter datacenter ) { EdgeSwitch [ ] edgeSwitches = new EdgeSwitch [ 1 ] ; for ( int i = 0 ; i < edgeSwitches . length ; i ++ ) { edgeSwitches [ i ] = new EdgeSwitch ( simulation , datacenter ) ; datacenter . addSwitch ( edgeSwitches [ i ] ) ; } for ( NetworkHost host : datacenter . < NetworkHost > getHostList ( ) ) { int switchNum = host . getId ( ) / edgeSwitches [ 0 ] . getPorts ( ) ; edgeSwitches [ switchNum ] . connectHost ( host ) ; host . setEdgeSwitch ( edgeSwitches [ switchNum ] ) ; } }
Creates internal Datacenter network.
Creates internal Datacenter network .