Skip to content

Part of cloudsimplus/cloudsimplus#650: Stop sharing stateful UtilizationModels - #51

Merged
manoelcampos merged 1 commit into
masterfrom
650-stateful-utilization-models
Nov 13, 2026
Merged

manoelcampos merged 1 commit into
masterfrom
650-stateful-utilization-models

Conversation

@manoelcampos

Copy link
Copy Markdown
Contributor

Part of cloudsimplus/cloudsimplus#650, which cloudsimplus/cloudsimplus#651 implemented.

CloudSim Plus now throws an IllegalStateException when a stateful UtilizationModel (a UtilizationModelDynamic with an update function, or a UtilizationModelStochastic without alwaysGenNewRandUtilization) is shared by many VMs or Cloudlets, since one changes the utilization the others get. These examples shared such models, so they were giving inaccurate results and now throw.

Changes

  • LoggingExample: createCloudlets() takes a Supplier<UtilizationModel>, so each Cloudlet gets its own model.
  • VmDestructionExample: a new createDynamicUtilizationModel() creates the CPU model for each Cloudlet.
  • MigrationExample1 and InterDatacenterMigration1: create the CPU model inside the loop, one for each Cloudlet.
  • UtilizationModelStochasticPerformance:
    • ALWAYS_GENERATE_NEW_RANDOM_UTILIZATION is now true by default, which is required to share a single model (the default, MULTIPLE_UTILIZATION_MODELS = false).
    • When using one model per Cloudlet, each gets a distinct seed (SEED + i). With the same seed, all Cloudlets got the same random values.

Tests

I ran the 11 examples that use setUtilizationUpdateFunction() or UtilizationModelStochastic against cloudsimplus master (with cloudsimplus/cloudsimplus#651). All of them finish without exceptions. UtilizationModelStochasticPerformance takes about 3.4 minutes (20,000 Hosts, 80,000 VMs, 160,000 Cloudlets).

🤖 Generated with Claude Code

@manoelcampos manoelcampos self-assigned this Nov 13, 2026
…ionModels

CloudSim Plus now throws when a stateful UtilizationModel is shared by
many VMs or Cloudlets, since that gives inaccurate results.

- LoggingExample, VmDestructionExample, MigrationExample1 and
  InterDatacenterMigration1 create one UtilizationModelDynamic with an
  update function for each Cloudlet.
- UtilizationModelStochasticPerformance enables
  alwaysGenNewRandUtilization by default, so its single shared model is
  stateless, and gives each model a distinct seed when using one per
  Cloudlet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@manoelcampos
manoelcampos force-pushed the 650-stateful-utilization-models branch from d957c9d to feb052f Compare November 13, 2026 07:08
@manoelcampos
manoelcampos merged commit c4523da into master Nov 13, 2026
1 check passed
@manoelcampos
manoelcampos deleted the 650-stateful-utilization-models branch November 13, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant