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.3KB

  1. package de.hems.trafficsim;
  2. /**
  3. * Model class which keeps the previous simulation data for analysis.
  4. */
  5. public class VehicleTimeRecord {
  6. /**
  7. * the id of the vehicle it belongs to
  8. */
  9. protected int id;
  10. /**
  11. * the position of the vehicle after the last simulation step
  12. */
  13. protected float position;
  14. /**
  15. * the velocity of the vehicle during the last simulation step
  16. */
  17. protected float velocity;
  18. /**
  19. * the maximum velocity of the vehicle
  20. */
  21. protected float maxVelocity;
  22. public float getMaxVelocity() {
  23. return maxVelocity;
  24. }
  25. public float getPosition() {
  26. return position;
  27. }
  28. public float getVelocity() {
  29. return velocity;
  30. }
  31. /**
  32. * Construct a new VehicleTimeRecord.
  33. *
  34. * @param id the id of the vehicle it belongs to
  35. * @param position the position of the vehicle after the last simulation step
  36. * @param velocity the velocity of the vehicle during the last simulation step
  37. * @param maxVelocity the maximum velocity of the vehicle
  38. */
  39. public VehicleTimeRecord(int id, float position, float velocity, float maxVelocity) {
  40. this.id = id;
  41. this.position = position;
  42. this.velocity = velocity;
  43. this.maxVelocity = maxVelocity;
  44. }
  45. }