cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/util/Helper.java
public static List<PowerHost> createHostList(int hostsNumber) {
        List<PowerHost> hostList = new ArrayList<>(hostsNumber);
        for (int i = 0; i < hostsNumber; i++) {
            int hostType = i % Constants.HOST_TYPES;

            List<Pe> peList = new ArrayList<>();
            for (int j = 0; j < Constants.HOST_PES[hostType]; j++) {
                peList.add(new PeSimple(Constants.HOST_MIPS[hostType], new PeProvisionerSimple()));
            }

            PowerHost host = new PowerHostUtilizationHistory(
                Constants.HOST_RAM[hostType], Constants.HOST_BW, Constants.HOST_STORAGE, peList);
            host.setPowerModel(Constants.HOST_POWER[hostType])
                .setRamProvisioner(new ResourceProvisionerSimple())
                .setBwProvisioner(new ResourceProvisionerSimple())
                .setVmScheduler(new VmSchedulerTimeSharedOverSubscription());
            hostList.add(host);
        }
        return hostList;
    }
/**
     * Creates the host list.
     *
     * @param hostsNumber the hosts number
     * @return the list< power host>
     */
Creates the host list.
@param hostsNumber the hosts number
@return the list< power host>
Creates the host list . @param hostsNumber the hosts number @return the list< power host >
public static List<PowerHost> createHostList(int hostsNumber) {
        List<PowerHost> hostList = new ArrayList<>(hostsNumber);
        for (int i = 0; i < hostsNumber; i++) {
            int hostType = i % Constants.HOST_TYPES;
            List<Pe> peList = new ArrayList<>();
            for (int j = 0; j < Constants.HOST_PES[hostType]; j++) {
                peList.add(new PeSimple(Constants.HOST_MIPS[hostType], new PeProvisionerSimple()));
            }
            PowerHost host = new PowerHostUtilizationHistory(
                Constants.HOST_RAM[hostType], Constants.HOST_BW, Constants.HOST_STORAGE, peList);
            host.setPowerModel(Constants.HOST_POWER[hostType])
                .setRamProvisioner(new ResourceProvisionerSimple())
                .setBwProvisioner(new ResourceProvisionerSimple())
                .setVmScheduler(new VmSchedulerTimeSharedOverSubscription());
            hostList.add(host);
        }
        return hostList;
    }
public static List < PowerHost > createHostList ( int hostsNumber ) { List < PowerHost > hostList = new ArrayList < > ( hostsNumber ) ; for ( int i = 0 ; i < hostsNumber ; i ++ ) { int hostType = i % Constants . HOST_TYPES ; List < Pe > peList = new ArrayList < > ( ) ; for ( int j = 0 ; j < Constants . HOST_PES [ hostType ] ; j ++ ) { peList . add ( new PeSimple ( Constants . HOST_MIPS [ hostType ] , new PeProvisionerSimple ( ) ) ) ; } PowerHost host = new PowerHostUtilizationHistory ( Constants . HOST_RAM [ hostType ] , Constants . HOST_BW , Constants . HOST_STORAGE , peList ) ; host . setPowerModel ( Constants . HOST_POWER [ hostType ] ) . setRamProvisioner ( new ResourceProvisionerSimple ( ) ) . setBwProvisioner ( new ResourceProvisionerSimple ( ) ) . setVmScheduler ( new VmSchedulerTimeSharedOverSubscription ( ) ) ; hostList . add ( host ) ; } return hostList ; }
Creates the host list.
Creates the host list .