Skip to content

Commit da1772d

Browse files
committed
VirtualMemoryForRequestedRamHigherThanAvailableExample refactoring
Signed-off-by: Manoel Campos <[email protected]>
1 parent 7c09940 commit da1772d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/org/cloudsimplus/examples/resourceusage/VirtualMemoryForRequestedRamHigherThanAvailableExample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public class VirtualMemoryForRequestedRamHigherThanAvailableExample {
107107
* As slower is the reading speed, higher is the memory swapping overhead
108108
* and the increase in cloudlet processing (exec) time.
109109
*/
110-
public static final int HOSTS_MAX_TRANSFER_RATE = 1600;
110+
private static final int HOSTS_MAX_TRANSFER_RATE = 1600;
111+
private static final long HOST_RAM = 2048; //in Megabytes
111112

112113
private static final int HOSTS = 2;
113114
private static final int HOST_PES = 8;
@@ -123,7 +124,6 @@ public class VirtualMemoryForRequestedRamHigherThanAvailableExample {
123124
*/
124125
public static final int VM_RAM = 1000;
125126

126-
127127
private final CloudSimPlus simulation;
128128
private final DatacenterBroker broker0;
129129
private List<Vm> vmList;
@@ -227,7 +227,6 @@ private Host createHost() {
227227
peList.add(new PeSimple(1000));
228228
}
229229

230-
final long ram = 2048; //in Megabytes
231230
final long bw = 10000; //in Megabits/s
232231
final long storageSize = 1000000; //in Megabytes
233232
final var hardDrive = new HarddriveStorage(storageSize);
@@ -237,7 +236,7 @@ private Host createHost() {
237236
Uses ResourceProvisionerSimple by default for RAM and BW provisioning
238237
and VmSchedulerSpaceShared for VM scheduling.
239238
*/
240-
return new HostSimple(ram, bw, hardDrive, peList);
239+
return new HostSimple(HOST_RAM, bw, hardDrive, peList);
241240
}
242241

243242
/**

0 commit comments

Comments
 (0)