Commit 8968021a authored by Rafael Vieira Falcão's avatar Rafael Vieira Falcão
Browse files

Merge branch 'info-aware-simulation' of...

Merge branch 'info-aware-simulation' of https://git.lsd.ufcg.edu.br/lenovo-autonomic/cloudsimplus into info-aware-simulation
parents 0d5fcc7c 4bdfc342
......@@ -118,16 +118,21 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
class VmRequestedAllocated implements Comparable<VmRequestedAllocated>{
private Vm vm;
private Long prevAllocated, requested, newCapacity;
private long prevAllocated, requested, newCapacity;
public VmRequestedAllocated(Vm vm, Long requested, Long newCapacity) {
public VmRequestedAllocated(Vm vm, long requested, long newCapacity) {
super();
this.vm = vm;
this.requested = requested;
this.prevAllocated = requested;
this.prevAllocated = vm.getResource(getResourceClass()).getAllocatedResource();
this.newCapacity = newCapacity;
}
@Override
public String toString() {
return "Vm id="+vm.getId()+", requested="+requested+", prevAllocated="+prevAllocated+", newCapacity="+newCapacity;
}
@Override
public boolean equals(Object obj) {
return vm.equals(obj);
......@@ -151,7 +156,7 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this.vm = vm;
}
public Long getRequested() {
public long getRequested() {
return requested;
}
......@@ -163,19 +168,19 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this.requested -= requested;
}
public Long getNewCapacity() {
public long getNewCapacity() {
return newCapacity;
}
public void setNewCapacity(Long newCapacity) {
public void setNewCapacity(long newCapacity) {
this.newCapacity = newCapacity;
}
public void addNewCapacity(Long extraCapacity) {
public void addNewCapacity(long extraCapacity) {
this.newCapacity += extraCapacity;
}
public Long getPrevAllocated() {
public long getPrevAllocated() {
return prevAllocated;
}
......
......@@ -83,6 +83,7 @@ public class CloudletSchedulerWithIops {
final List<Cloudlet> finishedCloudlets = broker0.getCloudletFinishedList();
// FIXME Test seems to base itself on values of a particular execution
assertTrue(finishedCloudlets.get(0).getFinishTime() == 10.1);
assertTrue(finishedCloudlets.get(1).getFinishTime() == 13.509999999999982);
assertTrue(finishedCloudlets.get(2).getFinishTime() == 20.32999999999995);
......@@ -108,14 +109,17 @@ public class CloudletSchedulerWithIops {
final long ram = 2048; //in Megabytes
final long bw = 10000; //in Megabits/s
final long iops = 10000;
final long storage = 1000000; //in Megabytes
ResourceProvisioner ramProvisioner = new ResourceProvisionerSimple();
ResourceProvisioner bwProvisioner = new ResourceProvisionerSimple();
ResourceProvisioner iopsProvisioner = new ResourceProvisionerSimple();
VmScheduler vmScheduler = new VmSchedulerTimeShared();
Host host = new HostSimple(ram, bw, storage, peList);
Host host = new HostSimple(ram, iops, bw, storage, peList);
host
.setRamProvisioner(ramProvisioner)
.setBwProvisioner(bwProvisioner)
.setIopsProvisioner(iopsProvisioner)
.setVmScheduler(vmScheduler);
return host;
}
......
......@@ -203,7 +203,7 @@ public final class VmCreationFailureIntegrationTest {
final BrokerBuilderDecorator brokerBuilder = scenario.getBrokerBuilder().createBroker();
brokerBuilder.getVmBuilder()
.setRam(512).setBw(1000).setIops(100)
.setRam(512).setBw(1000).setIops(1000)
.setPes(1).setMips(1000).setSize(10000)
.setCloudletSchedulerSupplier(() -> new CloudletSchedulerSpaceShared())
.setOnHostAllocationListener(evt -> onHostAllocation(evt))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment