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.

47 lines
1.1KB

  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 position of the vehicle after the last simulation step
  8. */
  9. final protected float position;
  10. /**
  11. * the velocity of the vehicle during the last simulation step
  12. */
  13. final protected float velocity;
  14. /**
  15. * the maximum velocity of the vehicle
  16. */
  17. final protected float maxVelocity;
  18. public float getMaxVelocity() {
  19. return maxVelocity;
  20. }
  21. public float getPosition() {
  22. return position;
  23. }
  24. public float getVelocity() {
  25. return velocity;
  26. }
  27. /**
  28. * Construct a new VehicleTimeRecord.
  29. *
  30. * @param position the position of the vehicle after the last simulation step
  31. * @param velocity the velocity of the vehicle during the last simulation step
  32. * @param maxVelocity the maximum velocity of the vehicle
  33. */
  34. public VehicleTimeRecord(float position, float velocity, float maxVelocity) {
  35. this.position = position;
  36. this.velocity = velocity;
  37. this.maxVelocity = maxVelocity;
  38. }
  39. }