diff --git a/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java b/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java index 332e1d3..f101aac 100755 --- a/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java +++ b/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java @@ -128,13 +128,12 @@ private void showSimulationResults() { for(int i = 0; i < APPS_NUMBER; i++){ final DatacenterBroker broker = brokerList.get(i); final var newCloudletList = broker.getCloudletFinishedList(); - String caption = broker.getName() + " - Application " + broker.getId(); new CloudletsTableBuilder(newCloudletList) - .setTitle(caption) + .setTitle("%s (broker %d)".formatted(broker.getName(), broker.getId())) .build(); System.out.printf( - "Number of NetworkCloudlets for Application %s: %d%n", - broker.getId(), newCloudletList.size()); + "Number of NetworkCloudlets for %s (broker %d): %d%n", + broker.getName(), broker.getId(), newCloudletList.size()); } for(NetworkHost host: datacenter.getHostList()){ @@ -153,8 +152,8 @@ private void showSimulationResults() { */ private List createBrokerForEachApp() { final var brokerList = new ArrayList(); - for(int i = 0; i < APPS_NUMBER; i++){ - brokerList.add(new DatacenterBrokerSimple(simulation)); + for(int i = 1; i <= APPS_NUMBER; i++){ + brokerList.add(new DatacenterBrokerSimple(simulation, "App "+i)); } return brokerList; diff --git a/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmsExampleWorkflowApp.java b/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmsExampleWorkflowApp.java index 3ddba76..c4be32c 100755 --- a/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmsExampleWorkflowApp.java +++ b/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmsExampleWorkflowApp.java @@ -36,10 +36,10 @@ public List createNetworkCloudlets(DatacenterBroker broker) { final List selectedVms = randomlySelectVmsForApp(networkCloudlets.length); for(int i = 0; i < networkCloudlets.length; i++){ - networkCloudlets[i] = createNetworkCloudlet(selectedVms.get(i), broker); + networkCloudlets[i] = createNetworkCloudlet(i, selectedVms.get(i), broker); System.out.printf( - "Created NetworkCloudlet %d for Application %d%n", - networkCloudlets[i].getId(), broker.getId()); + "Created NetworkCloudlet %d for %s (broker %d)%n", + networkCloudlets[i].getId(), broker.getName(), broker.getId()); } //NetworkCloudlet 0 Tasks @@ -61,13 +61,14 @@ public List createNetworkCloudlets(DatacenterBroker broker) { /** * Creates a {@link NetworkCloudlet}. * - * @param vm the VM that will run the created {@link NetworkCloudlet) + * @param id + * @param vm the VM that will run the created {@link NetworkCloudlet) * @param broker the broker that will own the create NetworkCloudlet * @return */ - private NetworkCloudlet createNetworkCloudlet(NetworkVm vm, DatacenterBroker broker) { + private NetworkCloudlet createNetworkCloudlet(final int id, NetworkVm vm, DatacenterBroker broker) { final var utilizationModel = new UtilizationModelFull(); - final var cloudlet = new NetworkCloudlet(CLOUDLET_PES); + final var cloudlet = new NetworkCloudlet(id, CLOUDLET_PES); cloudlet .setFileSize(CLOUDLET_FILE_SIZE) .setOutputSize(CLOUDLET_OUTPUT_SIZE)