MergeMsg.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package classes.holonControlUnit.messages;
  2. import java.util.ArrayList;
  3. public class MergeMsg {
  4. public enum Type {
  5. REQ, ACK, ACK_II
  6. }
  7. private Type type;
  8. private float power;
  9. private float netThroughput;
  10. private ArrayList<Float> predictedPowerUsage;
  11. private String requester;
  12. private int timeStep;
  13. private StateMsg state;
  14. private ArrayList<String> redirectedBy;
  15. private boolean allowOccupiedPath;
  16. public MergeMsg(Type type, float power, float netThroughput, ArrayList<Float> predictedPowerUsage, String requester,
  17. int timeStep, StateMsg state, ArrayList<String> redirectedBy, boolean allowOccupiedPath) {
  18. super();
  19. this.type = type;
  20. this.power = power;
  21. this.netThroughput = netThroughput;
  22. this.predictedPowerUsage = predictedPowerUsage;
  23. this.requester = requester;
  24. this.timeStep = timeStep;
  25. this.state = state;
  26. this.redirectedBy = redirectedBy;
  27. this.allowOccupiedPath = allowOccupiedPath;
  28. }
  29. @Override
  30. public String toString() {
  31. return "MergeMsg [type=" + type + ", power=" + power + ", netThroughput=" + netThroughput
  32. + ", predictedPowerUsage=" + predictedPowerUsage + ", requester=" + requester + ", timeStep=" + timeStep
  33. + ", state=" + state + ", redirectedBy=" + redirectedBy + ", allowOccupiedPath=" + allowOccupiedPath
  34. + "]";
  35. }
  36. public Type getType() {
  37. return type;
  38. }
  39. public float getPower() {
  40. return power;
  41. }
  42. public ArrayList<Float> getPredictedPowerUsage() {
  43. return predictedPowerUsage;
  44. }
  45. public String getRequester() {
  46. return requester;
  47. }
  48. public int getTimeStep() {
  49. return timeStep;
  50. }
  51. public float getNetThroughput() {
  52. return netThroughput;
  53. }
  54. public StateMsg getState() {
  55. return state;
  56. }
  57. public ArrayList<String> getRedirectedBy() {
  58. return redirectedBy;
  59. }
  60. public boolean isAllowOccupiedPath() {
  61. return allowOccupiedPath;
  62. }
  63. }