电科院-电能替代模型工具开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

package com.dky.calculate;
import com.dky.utils.result.MatchedDevice;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CalC {
public static List<Map<String, Double>> getC(List<Map<String, List<List<MatchedDevice>>>> list) {
List<Map<String, Double>> maps = new ArrayList<>();
list.parallelStream().forEach(stringListMap -> {
// 区分热泵、电锅炉
stringListMap.forEach((k,v)->{
// 循环遍历各个方案
final Double[] maxPower = {0.0};
v.parallelStream().forEach((plan)->{
Double power = 0.0;
for (MatchedDevice device : plan){
power = power + (device.getCount() * device.getDeviceHeatScene().getDevPower()) ;
}
if (power >= maxPower[0]){
maxPower[0] = power;
}
});
Map<String, Double> map = new HashMap<>();
map.put(k, maxPower[0]);
maps.add(map);
});
});
return maps;
}
public static Double getC1(List<List<MatchedDevice>> args) {
// 循环遍历各个方案
final Double[] maxPower = {-100.0};
args.parallelStream().forEach(plan -> {
Double power = 0.0;
for (MatchedDevice device : plan){
power = power + (device.getCount() * device.getDeviceHeatScene().getDevPower()) ;
}
if (power >= maxPower[0]){
maxPower[0] = power;
}
});
return maxPower[0];
}
}