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.

36 lines
755B

  1. package de.hems.trafficsim;
  2. public class Vehicle {
  3. protected float position;
  4. protected float curVelocity;
  5. protected float maxVelocity;
  6. public void setForerunner(Vehicle forerunner) {
  7. this.forerunner = forerunner;
  8. }
  9. protected Vehicle forerunner;
  10. public float getPosition() {
  11. return position;
  12. }
  13. public float getCurVelocity() {
  14. return curVelocity;
  15. }
  16. protected float brakeProp;
  17. public Vehicle(float position, float maxVelocity, float brakeProp) {
  18. this.position = position;
  19. this.maxVelocity = maxVelocity;
  20. this.brakeProp = brakeProp;
  21. this.curVelocity = 0;
  22. this.forerunner = null;
  23. }
  24. public void timeElapse(float timeStep) {
  25. }
  26. }