Did you ever wonder what drives the Cloudsim core simulation engine? The answer is the CloudsimTags.java class, which exists in org.cloudbus.cloudsim.core package.
CloudsimTags.java is the basic building block class, which contains the constant values defined against the actions that are to be performed during the simulation run.
The actions are defined as Register Resources, Cloudlet Submit, Vm creates, Vm Destroy, Vm Migrate, etc. CloudsimTags class contains a total of 57 variables where 55 are defined with a public modifier, and the other 2 are defined with private modifiers.
These variables defined as static final integers; therefore, these tag variables can be used without any class object initialization, and their values cannot be changed due to its final state.
In case during the simulation flow run, you want to put or call your action, then this is the class from where you should start planning the design of your implementation. The key markers that you should remember while adding a new tag are:
- The guideline comments defined by the author suggest that the range of values should be from 0 to 299, and an exclusive no 9600 reserved for describing the baud rate for the communication channel. Therefore the sequence of number series should be maintained. Till now, the sequence up to 49 is in use.
- There are two private variables defined named BASE and NETBASE, where the BASE set to 0(zero) and NETBASE set to 100(hundred). Both are used as a seed to determine two different sets of tags; therefore, the new tag values should be chosen carefully as per these categories to avoid any confusion at a later stage.
- The value assigned to a new tag should not overlap with the existing variable; otherwise, this will lead to a logical error due to ambiguity.
- This class cannot be instantiated i.e. the object cannot be created/initialized as cloudsimtags explicitly throws the exception for the same.
Now, Once the definition of the custom action tag completed, the new action tag can be utilized in any entity as per the requirement.
for example: In datacenter class within processevent() method Cloudlet_submit tag is used to start the call for processCloudletSubmit() method. You may initiate the call for your custom-defined respective method.
Is it still getting challenging to digest this article, then you have missed reading some essential articles related to cloudsim: CloudSim Simulation Toolkit: An Introduction and Beginners Guide to Cloudsim Project Structure.
In case you are looking for a comprehensive cloudsim tutorial, you should subscribe to “Essential Cloudsim Tutorials.”