finish homework2
Embed:
(wiki syntax)
Show/hide line numbers
AccCar.h
00001 //#ifndef _ACC_CAR_H_ 00002 //#define _ACC_CAR_H_ 00003 // 00004 //#include "mbed.h" 00005 // 00006 //// The road is 100 meters long 00007 //#define ROADLENGTH 100 00008 // 00009 //class AccCar { 00010 //public: 00011 // int position; // Position, in meters, of the car 00012 // int speed; // Speed, in meters, of the car to be used to update the position next Update 00013 // 00014 // // Add any other needed public attributes 00015 // // ... 00016 // // ... 00017 // 00018 // 00019 // // Constructor for the AccCar class 00020 // // Modify as necessary to provide the AccCar object with 00021 // // access additional resources (such as a reference to another car...) 00022 // AccCar(int id); 00023 // 00024 // // Update the position and speed of the car in a 1 second loop 00025 // void update(); 00026 // 00027 // // Reset the position of the car to 0 and set the target speed to the given speed 00028 // void reset(int speed); 00029 // 00030 // int acc_is_simulating(); 00031 // 00032 //private: 00033 // int id; // Identifier so that we can distinguish between cars 00034 // Thread* thread; // Thread on which to run the car 00035 // int assigned_speed; // The speed, in meters, the AccCar wants to go, if there are no obstacles 00036 // int acc_simulation; 00037 // 00038 // void update_pos(); 00039 // 00040 // // Add any other needed private attributes 00041 // // ... 00042 // // ... 00043 //}; 00044 //#endif
Generated on Thu Jul 14 2022 17:18:57 by
1.7.2