From 535fde4b5d277a99f56a8eda1d451abfdc6fcc82 Mon Sep 17 00:00:00 2001 From: Manoel Campos Date: Tue, 20 Oct 2026 05:21:00 -0300 Subject: [PATCH 1/3] Disable VM creation retry in CostsExample1 to avoid infinite loop Closes #31 Co-Authored-By: Claude Opus 5.5 --- .../java/org/cloudsimplus/examples/costs/CostsExample1.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java index bb621f7..3b67e90 100755 --- a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java +++ b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java @@ -120,6 +120,9 @@ private CostsExample1() { */ private DatacenterBroker createBroker() { final var broker = new DatacenterBrokerSimple(simulation); + //Disables VM creation retry, so that VMs that couldn't be placed aren't retried forever + broker.getVmCreation().setRetryDelay(-1); + //Destroys idle VMs after some time (in seconds) broker.setVmDestructionDelay(0.2); return broker; From efd523e122f9788960ddbab3bfde33fb3c2cfbd0 Mon Sep 17 00:00:00 2001 From: Manoel Campos Date: Tue, 20 Oct 2026 05:49:46 -0300 Subject: [PATCH 2/3] Clarify VM creation retry comment in CostsExample1 Co-Authored-By: Claude Opus 5.5 --- .../java/org/cloudsimplus/examples/costs/CostsExample1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java index 3b67e90..c80b7e7 100755 --- a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java +++ b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java @@ -120,7 +120,7 @@ private CostsExample1() { */ private DatacenterBroker createBroker() { final var broker = new DatacenterBrokerSimple(simulation); - //Disables VM creation retry, so that VMs that couldn't be placed aren't retried forever + //Disables VM creation retry, so that VMs that can't be placed are just added to the broker's failed VM list broker.getVmCreation().setRetryDelay(-1); //Destroys idle VMs after some time (in seconds) From d73ec118466aae2a85f2bbb28516d293c6fcbf68 Mon Sep 17 00:00:00 2001 From: Manoel Campos Date: Tue, 20 Oct 2026 05:50:38 -0300 Subject: [PATCH 3/3] Update CostsExample1 docs to match its current behavior Co-Authored-By: Claude Opus 5.5 --- .../org/cloudsimplus/examples/costs/CostsExample1.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java index c80b7e7..0aef31e 100755 --- a/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java +++ b/src/main/java/org/cloudsimplus/examples/costs/CostsExample1.java @@ -48,9 +48,8 @@ /** * A simple example showing how to define datacenter resource utilization * and individual VM's costs ($). - * It creates VMs that run some cloudlets. - * Some VMs will just be idle all the time and - * other ones won't be created due to lack of available Hosts. + * It creates VMs that run some cloudlets, + * while other VMs will just be idle all the time. * * @author Manoel Campos da Silva Filho * @since CloudSim Plus 6.2.7 @@ -116,7 +115,7 @@ private CostsExample1() { /** * Creates a broker which is a software acting on behalf of a cloud customer to manage his/her VMs and Cloudlets. - * It disables VMs creation retry, this way, failed VMs will be just added to the {@link DatacenterBroker#getVmFailedList()}. + * It disables VM creation retry, so that VMs that can't be placed are just added to the {@link DatacenterBroker#getVmFailedList()}. */ private DatacenterBroker createBroker() { final var broker = new DatacenterBrokerSimple(simulation);