Hello,
The task are generated by the concrete implementation of LoadGeneratorModel abstract class.
By default EdgeCloudSim provides IdleActiveLoadGenerator class.
You can implement your own load generator model if you want, and provide it to the system via your ScenarioFactory class.
Basically, LoadGeneratorModel uses a hashmap which includes the time and task pairs.
In SimManager.java, this hashmap is iterated and the related tasks are injected to the system.
Please consider lines 197-199:
//Creation of tasks are scheduled here!
for(int i=0; i< loadGeneratorModel.getTaskList().size(); i++)
schedule(getId(), loadGeneratorModel.getTaskList().get(i).startTime, CREATE_TASK, loadGeneratorModel.getTaskList().get(i));
Selecting the VMs on mobile depends on the scenario you designed.
In sample_app3, we have 3 different scenarios and the workload orchestration works as follows:
ONLY_EDGE: all the tasks are offloaded to the edge servers
ONLY_MOBILE: all the tasks are executed on the mobile device
HYBRID: The task is executed on the mobile device if it has enough processing capacity. Otherwise the task is offloaded to the edge servers
Please note that these are the simple policies just for demonstration purpose.
Normally, you should have more sophisticated orchestration policy (algorithm).
Regards,
Cagatay