Пример #1
0
  public static double calculateCostDesired(MSApplicationNode node, IMSProvider prov) {
    double costPerStorage =
        (Double) prov.getStorage().getCharacteristic().get(Constant.COST_STORAGE);
    long storage = (long) node.getDesiredCharacteristic().get(Constant.STORE);
    Double costS = storage * costPerStorage;

    Double costPerMem = (Double) prov.getCharacteristic().get(Constant.COST_MEM);
    Integer ram = (Integer) node.getDesiredCharacteristic().get(Constant.RAM);
    Double costM = ram * costPerMem;

    Double costPerCPU = (Double) prov.getCharacteristic().get(Constant.COST_SEC);
    Integer cpu_number = (Integer) node.getDesiredCharacteristic().get(Constant.CPU_NUMBER);
    Double costCPU = cpu_number * costPerCPU;
    return costS + costM + costCPU;
  }
Пример #2
0
 private static double cpuCost(MSApplicationNode node, IMSProvider prov) {
   Double costPerCPU = (Double) prov.getCharacteristic().get(Constant.COST_SEC);
   Integer cpu_number = (Integer) node.getComputing().getCharacteristic().get(Constant.CPU_NUMBER);
   Double cost = cpu_number * costPerCPU;
   return cost;
 }
Пример #3
0
 private static double ramCost(MSApplicationNode node, IMSProvider prov) {
   Double costPerMem = (Double) prov.getCharacteristic().get(Constant.COST_MEM);
   Integer ram = (Integer) node.getComputing().getCharacteristic().get(Constant.RAM);
   Double cost = ram * costPerMem;
   return cost;
 }