// vehicle.h for traffic simulation // includes class route for vehicle #ifndef VEHICLE_H_ #define VEHICLE_H_ #include "simulation.h" class route { public: route():intersection_count(0), moving(reset), next(0){} // default last move route(int Aroute_count, direction Amoving, route * route_list); void add_route( int Aroute_count, direction Amoving); direction get_moving(void); int get_count(void); route * get_next(void); private: int intersection_count; direction moving; route *next; }; // vehicle.h the vehicle class for autonomous vehicle class vehicle { public: vehicle( float Alength, float Aweight, float Aaccel, float Adecell, float Aposition, float Aspeed, float Aspeed_limit, float Ax_base, float Ay_base, direction Amoving, float Asignal_pos, signal_state Asignal, vehicle *Anext_ptr); void move(void); vehicle *next(void); void new_next( vehicle *a_next ); bool exiting( void ); void set_new_lane_data(float Aspeed_limit, float Ax_base, float Ay_base, direction Amoving, float Asignal_pos, signal_state Asignal); void set_signal(signal_state Asignal); void draw(bool erase_only=false); private: int id; float length; float weight; float accel; float decell; float position; float position_last; float speed; float speed_limit; float time_last_move; float x_base; float y_base; direction moving; signal_state signal; float signal_pos; route * route_list; route * route_now; int route_count; vehicle *next_ptr; }; // end vehicle.h #endif // VEHICLE_H_