cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/TwoCloudletsAndOneSpaceSharedVmExample.java
private Datacenter createDatacenter() {
        // Here are the steps needed to create a DatacenterSimple:
        // 1. We need to create a list to store
        // our machine
        List<Host> hostList = new ArrayList<>();

        // 2. A Machine contains one or more PEs or CPUs/Cores.
        // In this example, it will have only one core.
        List<Pe> peList = new ArrayList<>();

        long mips = 1000;

        // 3. Create PEs and add these into a list.
        peList.add(new PeSimple(mips, new PeProvisionerSimple())); // need to store Pe id and MIPS Rating

        // 4. Create HostSimple with its id and list of PEs and add them to the list of machines
        final long ram = 20000; //in Megabytes
        final long bw = 100000; //in Megabytes
        final long storage = 10000000; //in Megabites/s
        final int id = hostList.size();
        Host host = new HostSimple(ram, bw, storage, peList)
            .setRamProvisioner(new ResourceProvisionerSimple())
            .setBwProvisioner(new ResourceProvisionerSimple())
            .setVmScheduler(new VmSchedulerTimeShared());

        hostList.add(host);

        // 5. Create a DatacenterCharacteristics object that stores the
        // properties of a data center: architecture, OS, list of
        // Machines, allocation policy: time- or space-shared, time zone
        // and its price (G$/Pe time unit).
        double cost = 3.0; // the cost of using processing in this resource
        double costPerMem = 0.05; // the cost of using memory in this resource
        double costPerStorage = 0.001; // the cost of using storage in this
        // resource
        double costPerBw = 0.0; // the cost of using bw in this resource

        DatacenterCharacteristics characteristics =
            new DatacenterCharacteristicsSimple(hostList)
                .setCostPerSecond(cost)
                .setCostPerMem(costPerMem)
                .setCostPerStorage(costPerStorage)
                .setCostPerBw(costPerBw);

        // 6. Finally, we need to create a DatacenterSimple object.
        return new DatacenterSimple(simulation, characteristics, new VmAllocationPolicySimple());
    }
/**
     * Creates the Datacenter.
     *
     * @return the Datacenter
     */
Creates the Datacenter.
@return the Datacenter
Creates the Datacenter . @return the Datacenter
private Datacenter createDatacenter() {
        List<Host> hostList = new ArrayList<>();
        List<Pe> peList = new ArrayList<>();
        long mips = 1000;
        peList.add(new PeSimple(mips, new PeProvisionerSimple())); 
        final long ram = 20000; 
        final long bw = 100000; 
        final long storage = 10000000; 
        final int id = hostList.size();
        Host host = new HostSimple(ram, bw, storage, peList)
            .setRamProvisioner(new ResourceProvisionerSimple())
            .setBwProvisioner(new ResourceProvisionerSimple())
            .setVmScheduler(new VmSchedulerTimeShared());
        hostList.add(host);
        double cost = 3.0; 
        double costPerMem = 0.05; 
        double costPerStorage = 0.001; 
        double costPerBw = 0.0; 
        DatacenterCharacteristics characteristics =
            new DatacenterCharacteristicsSimple(hostList)
                .setCostPerSecond(cost)
                .setCostPerMem(costPerMem)
                .setCostPerStorage(costPerStorage)
                .setCostPerBw(costPerBw);
        return new DatacenterSimple(simulation, characteristics, new VmAllocationPolicySimple());
    }
private Datacenter createDatacenter ( ) { List < Host > hostList = new ArrayList < > ( ) ; List < Pe > peList = new ArrayList < > ( ) ; long mips = 1000 ; peList . add ( new PeSimple ( mips , new PeProvisionerSimple ( ) ) ) ; final long ram = 20000 ; final long bw = 100000 ; final long storage = 10000000 ; final int id = hostList . size ( ) ; Host host = new HostSimple ( ram , bw , storage , peList ) . setRamProvisioner ( new ResourceProvisionerSimple ( ) ) . setBwProvisioner ( new ResourceProvisionerSimple ( ) ) . setVmScheduler ( new VmSchedulerTimeShared ( ) ) ; hostList . add ( host ) ; double cost = 3.0 ; double costPerMem = 0.05 ; double costPerStorage = 0.001 ; double costPerBw = 0.0 ; DatacenterCharacteristics characteristics = new DatacenterCharacteristicsSimple ( hostList ) . setCostPerSecond ( cost ) . setCostPerMem ( costPerMem ) . setCostPerStorage ( costPerStorage ) . setCostPerBw ( costPerBw ) ; return new DatacenterSimple ( simulation , characteristics , new VmAllocationPolicySimple ( ) ) ; }
Creates the Datacenter.
Creates the Datacenter .
// Here are the steps needed to create a DatacenterSimple: // 1. We need to create a list to store // our machine // 2. A Machine contains one or more PEs or CPUs/Cores. // In this example, it will have only one core. // 3. Create PEs and add these into a list. // need to store Pe id and MIPS Rating // 4. Create HostSimple with its id and list of PEs and add them to the list of machines //in Megabytes //in Megabytes //in Megabites/s // 5. Create a DatacenterCharacteristics object that stores the // properties of a data center: architecture, OS, list of // Machines, allocation policy: time- or space-shared, time zone // and its price (G$/Pe time unit). // the cost of using processing in this resource // the cost of using memory in this resource // the cost of using storage in this // resource // the cost of using bw in this resource // 6. Finally, we need to create a DatacenterSimple object.