Trouble with scheduling

2 views
Skip to first unread message

Da BrotherHoud

unread,
Feb 21, 2020, 9:33:37 AM2/21/20
to CloudSim Plus
I am having trouble figuring out where to implement my scheduling algorithm. I need to alter the way the cloudlet list is sorted, but also change the defaultVmMapper of the Datacenter Brokers. The latter I can do no problem, however I am struggling to find when this method is called at all. Any help is greatly appreciated.

Thank you,

Jamel

Manoel Campos

unread,
Mar 14, 2020, 4:44:34 PM3/14/20
to clouds...@googlegroups.com
Hello,

If you need to change the order in which Cloudlets are submitted to VMs by a DatacenterBroker,
you can call the DatacenterBroker.setCloudletComparator method.
You can provide a Comparator that defines the way Cloudlets are sorted.
It's possible to implement complex Comparators. The example below sorts submitted Cloudlets
based on the number of PEs and length, in reserve order:

// import static java.util.Comparator.comparingDouble;
// import static java.util.Comparator.comparingLong;

Comparator<Cloudlet> comparator = 
        comparingLong(Cloudlet::getNumberOfPes)
            .thenComparing(comparingDouble(Cloudlet::getLength));
broker.setCloudletComparator(comparator.reversed());

Manoel Campos da Silva Filho Software Engineer

Computer Science and Engineering Ph.D. Student at University of Beira Interior (Portugal)

Professor at Federal Institute of Education, Science and Technology of Tocantins (Brazil)

http://manoelcampos.com


 about.me


--
If you received an answer that worked for you, please be kind and reply to let everybody knows it worked.
http://cloudsimplus.org
---
You received this message because you are subscribed to the Google Groups "CloudSim Plus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudsim-plu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudsim-plus/44250be4-c0a6-4f76-b56d-1a73e647acbd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages