CpsEdge.java 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package classes;
  2. public class CpsEdge {
  3. float maxCapacity;
  4. float flow;
  5. CpsObject A;
  6. CpsObject B;
  7. public CpsEdge(CpsObject A, CpsObject B){
  8. setA(A);
  9. setB(B);
  10. this.flow = 50;
  11. this.A.AddConnection(this);
  12. this.B.AddConnection(this);
  13. this.maxCapacity = 100;
  14. }
  15. /**
  16. * @return the capacity
  17. */
  18. public float getCapacity() {
  19. return maxCapacity;
  20. }
  21. /**
  22. * @param cap the Capacity to set
  23. */
  24. public void setCapacity(float cap) {
  25. this.maxCapacity = cap;
  26. }
  27. /**
  28. * @return the flow
  29. */
  30. public float getFlow() {
  31. return flow;
  32. }
  33. /**
  34. * @param flow the flow to set
  35. */
  36. public void setFlow(float flow) {
  37. this.flow = flow;
  38. }
  39. /**
  40. * @return the a
  41. */
  42. public CpsObject getA() {
  43. return A;
  44. }
  45. /**
  46. * @param a the a to set
  47. */
  48. public void setA(CpsObject a) {
  49. A = a;
  50. }
  51. /**
  52. * @return the b
  53. */
  54. public CpsObject getB() {
  55. return B;
  56. }
  57. /**
  58. * @param b the b to set
  59. */
  60. public void setB(CpsObject b) {
  61. B = b;
  62. }
  63. }