45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
54 : myDistricts(dc), myNoLoaded(0), myNoWritten(0), myNoDiscarded(0) {}
67 SUMOTime end,
const std::string& origin,
const std::string& destination,
68 const std::string& vehicleType) {
71 WRITE_WARNING(
"Missing origin '" + origin +
"' and destination '" + destination +
"' (" +
toString(vehicleNumber) +
" vehicles).");
75 }
else if (
myDistricts.
get(destination) == 0 && vehicleNumber > 0) {
76 WRITE_ERROR(
"Missing destination '" + destination +
"' (" +
toString(vehicleNumber) +
" vehicles).");
80 WRITE_ERROR(
"District '" + origin +
"' has no source.");
83 WRITE_ERROR(
"District '" + destination +
"' has no sink.");
101 size_t& vehName, std::vector<ODVehicle>& into,
102 bool uniform,
const std::string& prefix) {
111 for (
int i = 0; i < vehicles2insert; ++i) {
133 const std::string& prefix,
bool stepLog) {
138 std::map<std::pair<std::string, std::string>,
SUMOReal> fractionLeft;
143 std::vector<ODCell*>::iterator next =
myContainer.begin();
144 std::vector<ODVehicle> vehicles;
147 for (
SUMOTime t = begin; t != end;) {
148 if (stepLog && t - lastOut >=
DELTA_T) {
149 std::cout <<
"Parsing time " +
time2string(t) <<
'\r';
153 bool changed =
false;
154 while (next !=
myContainer.end() && (*next)->begin <= t && (*next)->end > t) {
155 std::pair<std::string, std::string> odID = std::make_pair((*next)->origin, (*next)->destination);
157 if (fractionLeft.find(odID) != fractionLeft.end()) {
158 (*next)->vehicleNumber += fractionLeft[odID];
159 fractionLeft[odID] = 0;
162 const size_t oldSize = vehicles.size();
164 if (oldSize != vehicles.size()) {
168 fractionLeft[odID] = fraction;
175 for (std::vector<ODVehicle>::reverse_iterator i = vehicles.rbegin(); i != vehicles.rend() && (*i).depart == t; ++i) {
178 if (!noVtype && (*i).cell->vehicleType.length() != 0) {
182 if (oc.
isSet(
"departlane") && oc.
getString(
"departlane") !=
"default") {
185 if (oc.
isSet(
"departpos")) {
188 if (oc.
isSet(
"departspeed") && oc.
getString(
"departspeed") !=
"default") {
191 if (oc.
isSet(
"arrivallane")) {
194 if (oc.
isSet(
"arrivalpos")) {
197 if (oc.
isSet(
"arrivalspeed")) {
202 while (vehicles.size() != 0 && vehicles.back().depart == t) {
205 if (!vehicles.empty()) {
206 t = vehicles.back().depart;
208 if (next !=
myContainer.end() && (t > (*next)->begin || vehicles.empty())) {
211 if (next ==
myContainer.end() && vehicles.empty()) {
238 for (
size_t i = 0; i < ps.
getAreaNo(); ++i) {
246 newCells.push_back(ncell);
255 for (std::vector<ODCell*>::iterator i = oldCells.begin(); i != oldCells.end(); ++i) {
256 std::vector<ODCell*> newCells;
258 copy(newCells.begin(), newCells.end(), back_inserter(
myContainer));