CloudComputer.java 799 B

12345678910111213141516171819202122232425262728293031
  1. package com.rongwei.cloudbalancing.domain;
  2. import lombok.Data;
  3. import lombok.EqualsAndHashCode;
  4. import lombok.NoArgsConstructor;
  5. @EqualsAndHashCode(callSuper = true)
  6. @Data
  7. @NoArgsConstructor
  8. public class CloudComputer extends AbstractPersistable {
  9. private int cpuPower;
  10. private int memory;
  11. private int networkBandwidth;
  12. private int cost;
  13. public CloudComputer(long id, int cpuPower, int memory, int networkBandwidth, int cost) {
  14. super(id);
  15. this.cpuPower = cpuPower;
  16. this.memory = memory;
  17. this.networkBandwidth = networkBandwidth;
  18. this.cost = cost;
  19. }
  20. public int getMultiplicand() {
  21. return this.cpuPower * this.memory * this.networkBandwidth;
  22. }
  23. public String getLabel() {
  24. return "Computer " + id;
  25. }
  26. }