Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert the static methods and attributes in CloudSim class to instance methods and attributes #38
CloudSim class is used just in a static context, since all its methods and attributes are static. By this way, the class stores data related to a particular simulation being run, what makes impossible to run multiple simulations in parallel.
Using CloudSim instances will provide a complete isolation between simulations being executed in parallel.
The use of static methods also makes very difficult to test classes that depend on CloudSim class.
Detailed information about how the feature should work
The static elements in CloudSim class have to be converted to instance elements and the class has to provide public constructors to be used to initialise the simulation, instead of calling a static init method.
An example scenario where this feature should be used
It will allow running several simulations in parallel, avoiding that a simulation interfere in the results of other ones.
It will also make much easier to write unit tests for classes that depend on CloudSim, since a simple library such as EasyMock, that is already being used, can create mock objects without a large increase in tests complexity.
A brief explanation of why you think this feature is useful
It will take one step further in moving away from CloudSim issues and paving the way to provide a highly extensible and maintainable framework.
It will allow writing more and meaningful tests to increase framework accuracy and provides the base for inclusion of upcoming features.