Conversation
…List and Dict general struct, add person struct and transfer point struct
…nto multi-mode-clean
| newTrafficVehicleVec.push_back(vehicle); | ||
| } | ||
|
|
||
| newTrafficPersonVec.push_back(person); |
There was a problem hiding this comment.
Add dep_time into the vehicles. whether bus or auto.
| } | ||
|
|
||
|
|
||
| if (carType == 2) { //bike car |
There was a problem hiding this comment.
@Luze, what's this for? Did you add this when we need a bike? Should we delete this for now? AFAIK our simulation is not using this cpp file
| // } | ||
| //} | ||
|
|
||
| return all_od_pairs_sets; |
There was a problem hiding this comment.
Does this include both bus routes and vehicle routes?
|
|
||
| } | ||
|
|
||
| for (size_t i = 0; i < busRoutes.size(); ++i) { |
There was a problem hiding this comment.
@SLZ0106 This should be reading trip ID, and use the new bus_shcedule file Junzhe
LivingCity/traffic/b18EdgeData.h
Outdated
| ushort totalInOutEdges; | ||
| uint edge[24];// up to six arms intersection | ||
| float nextEvent; | ||
| LNode* passengers; |
| struct B18TrafficPerson{ | ||
| int id; | ||
| Node* transferPoints; //should take which bus line and drop at which intersection | ||
| float time_departure; |
There was a problem hiding this comment.
TODO: This will be put into Dnode, so it will be deleted here @YiboZh
| std::vector<std::array<abm::graph::vertex_t, 2>> all_od_pairs_without_mode; | ||
| all_modes.reserve(all_od_pairs_.size()); | ||
| all_od_pairs_without_mode.reserve(all_od_pairs_.size()); | ||
| for (const auto& od_pair_with_mode : all_od_pairs_) { |
There was a problem hiding this comment.
all_modes will be used for replacing mode in .cu while running simulation
| return const_paths_SP; | ||
| } | ||
|
|
||
| //merge multi path into one path |
There was a problem hiding this comment.
TODO: When we are outputting the things from the simulator, we need to change the things to be output in people and route file.
| } | ||
| } | ||
| std::vector<int> findBuses( | ||
| const std::vector<std::vector<int>>& busRoutes, |
| float totalNumSteps = 0; | ||
| float totalCO = 0; | ||
|
|
||
| std::ofstream outFile("output_time_diff.csv", std::ios::app); |
| cudaStreamCreate( &streams[i]); | ||
| } | ||
|
|
||
| // Initialize people and vehicles |
| newTrafficPersonVec.push_back(person); | ||
| } | ||
|
|
||
| for (size_t i = 0; i < busRoutes.size(); ++i) { |
There was a problem hiding this comment.
vehicle and how it will follow its route?
There was a problem hiding this comment.
TODO: Auto follows original path, bus follows bus route @YiboZh
| // gpuErrchk(cudaMemPrefetchAsync(trafficLights_d, sizeT, 1, streams[1])); | ||
|
|
||
| } | ||
|
|
There was a problem hiding this comment.
Dnode要初始化departure time
| } | ||
|
|
||
| /*Add transfer function to simulate people change from a bus to another bus*/ | ||
| __device__ void transferToNewVehicle( |
There was a problem hiding this comment.
TODO: new vehicle's bus should be initialized outside kernal
There was a problem hiding this comment.
potential solution: get route from person struct
| Node* passengers; // a list of persons, key is the intersection id, value is the list of persons to drop off | ||
|
|
||
| //save travel time | ||
| float time_diff; |
| cudaSetDevice(i); | ||
| int numPeople_gpu = vehicles_vec[i]->size(); | ||
| LC::B18TrafficVehicle* vehicles_ptr = thrust::raw_pointer_cast((*vehicles_vec[i]).data()); | ||
| LC::B18TrafficPerson* person_ptr = trafficPerson_d; |
|
|
||
| struct B18TrafficPerson{ | ||
| int id; | ||
| Node* transferPoints; //should take which bus line and drop at which intersection |
There was a problem hiding this comment.
Add num_step to this property to track travel time.
To be fix: init the first segment of trip in transfer point to save travel time
No description provided.