bool MSVehicleControl::addVType(MSVehicleType* vehType) { if (checkVType(vehType->getID())) { myVTypeDict[vehType->getID()] = vehType; return true; } return false; }
bool RONet::addVTypeDistribution(const std::string& id, RandomDistributor<SUMOVTypeParameter*>* vehTypeDistribution) { if (checkVType(id)) { myVTypeDistDict[id] = vehTypeDistribution; return true; } return false; }
bool MSVehicleControl::addVTypeDistribution(const std::string& id, RandomDistributor<MSVehicleType*>* vehTypeDistribution) { if (checkVType(id)) { myVTypeDistDict[id] = vehTypeDistribution; return true; } return false; }
bool RONet::addVehicleType(SUMOVTypeParameter* type) { if (checkVType(type->id)) { myVehicleTypes.add(type->id, type); } else { WRITE_ERROR("The vehicle type '" + type->id + "' occurs at least twice."); delete type; return false; } return true; }
bool MSVehicleControl::addVTypeDistribution(const std::string& id, RandomDistributor<MSVehicleType*>* vehTypeDistribution) { if (checkVType(id)) { myVTypeDistDict[id] = vehTypeDistribution; std::vector<MSVehicleType*> vehTypes = vehTypeDistribution->getVals(); for (auto vehType : vehTypes) { if (myVTypeToDist.find(vehType->getID()) != myVTypeToDist.end()) { myVTypeToDist[vehType->getID()].insert(id); } else { myVTypeToDist[vehType->getID()] = { id }; } } return true; } return false; }