-
Notifications
You must be signed in to change notification settings - Fork 0
Vehicle.java
Raphael Lutz edited this page Aug 19, 2018
·
2 revisions
Represents the vehicles of the simulation
-
static int idCounter = 1: a counter on the IDs of the vehicle, static field. -
int id: the ID of the current vehicle, set on the static counter. -
Cell cell: current cell on which is the vehicle. -
Cell nextPlace: the next cell where the vehicle will go after one step. -
int speed = 1: the current speed of the vehicle. -
boolean hasToLeave = false: tells if the vehicle has to leave the network.
-
Vehicle(): the constructor of the class. -
void evolve(): update the current locationcellwith the new onenextPlace. -
void leaveNetwork(): called if the vehicle has to leave the Network. -
void stayHere(): called if the vehicle must stay at its location. -
void goToNextCell(): called if the vehicle has to go to thenextCellof its location. -
void goToOutCell(): called if the vehicle has to go to theoutCellof its location. -
void accelerate(): accelerate the vehicle by 1 unit. -
void decelerate(): accelerate the vehicle by 1 unit.
Getters and setters for some of the fields.
- data/
- DataManager.java (TODO)
- ExpVarCalculator.java (TODO)
- VehicleCounter.java (TODO)
- elements/
- Cell.java (TODO)
- Connection.java (TODO)
- CrossRoad.java (empty) (TODO)
- Direction.java (TODO)
- MaxVehicleOutflow.java (TODO)
- MultiLaneRoundAbout.java (TODO)
- Phase.java (TODO)
- Ride.java (TODO)
- Road.java (empty) (TODO)
- RoundAbout.java (empty) (TODO)
- TrafficLightsSystem.java (TODO)
- Vehicle.java (TODO)
- graphics/
- Assets.java (TODO)
- Display.java (TODO)
- ImageLoader.java (TODO)
- SpriteSheet.java (TODO)
- Text.java (TODO)
- input/
- KeyManager.java (TODO)
- MouseManager.java (TODO)
- main/
- Main.java (TODO)
- Simulation.java (TODO)
- network/
- AllNetworkRides.java (empty) (TODO)
- Network.java (TODO)
- NetworkComputing.java (TODO)
- NetworkRendering.java (TODO)
- states/
- MenuState.java (TODO)
- SimSettingsState.java (TODO)
- SimState.java (TODO)
- State.java (TODO)
- ui/
- ClickListener.java (TODO)
- UIImageButton.java (TODO)
- UIManager.java (TODO)
- UIObject.java (TODO)
- UISlider.java (TODO)
- UISliderDouble.java (TODO)
- UISliderTriple.java (TODO)
- UITextButton.java (TODO)
- UITextSwitch.java (TODO)
- utils/
- Defaults.java (TODO)
- OriginDestinationCalculator.java (TODO)
- SortByPos.java (TODO)
- Utils.java (TODO)