Cloudslab / cloudsim

CloudSim: A Framework For Modeling And Simulation Of Cloud Computing Infrastructures And Services
http://www.cloudbus.org/cloudsim/
810 stars 492 forks source link

Some events are not being removed from FutureQueue and are treated more than one time #90

Open giovannifs opened 7 years ago

giovannifs commented 7 years ago

Hi all,

I am using CloudSim and figured out that some events were not removed from FutureQueue at the first time they were treated. Analysing the code, I noticed that while CloudSim class where running runClockTick method, there were some moments that future.remove(first) and future.removeAll(toRemove) were not working propertly. Sometimes some events were not removed from the structure even when remove and removeAll methods return true.

So, I figured out that other developers already had have problems in remove elements from a SortedSet (which is the structure used in FutureQueue class). Is there any special condition for using SortedSet data structure in FutureQueue class?

In my case, I changed the structure from SortedSet to TreeSet and I am always removing the first event from FutureQueue through a poll() method that I implemented. It works for me.