-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPayloadContainer.java
43 lines (33 loc) · 1.29 KB
/
PayloadContainer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.cloudbus.cloudsim.examples;
import java.util.LinkedList;
import java.util.List;
import org.cloudbus.cloudsim.Datacenter;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.core.CloudSim;
public class PayloadContainer {
public List<DataCenterInfo> dataCenterList;
public List<BrokerInfo> brokerList;
public double clock;
public PayloadContainer(List<Datacenter> datacenterList, List <DatacenterBroker> brokerList) {
this.brokerList = constructBrokerList(brokerList);
this.dataCenterList = constructDataCenterList(datacenterList);
this.clock = CloudSim.clock();
}
public List<BrokerInfo> constructBrokerList(List<DatacenterBroker> list) {
List<BrokerInfo> brokerList = new LinkedList<BrokerInfo>();
for(DatacenterBroker cloudsimBroker : list) {
BrokerInfo payloadBroker = new BrokerInfo(cloudsimBroker);
brokerList.add(payloadBroker);
}
return brokerList;
}
public List<DataCenterInfo> constructDataCenterList(List<Datacenter> list) {
List<DataCenterInfo> dataCenterList = new LinkedList<DataCenterInfo>();
for(Datacenter cloudsimDatacenter : list) {
DataCenterInfo payloadDatacenter = new DataCenterInfo(cloudsimDatacenter);
dataCenterList.add(payloadDatacenter);
}
return dataCenterList;
}
}