42 std::vector<std::string>
43 Calibrator::getIDList() {
44 std::vector<std::string> ids;
46 ids.push_back(item.first);
48 std::sort(ids.begin(), ids.end());
53 Calibrator::getIDCount() {
54 return (
int)getIDList().size();
65 if (lane ==
nullptr) {
112 std::vector<std::string>
114 std::vector<std::string> result;
116 result.insert(result.begin(), vTypes.begin(), vTypes.end());
117 std::sort(result.begin(), result.end());
138 Calibrator::getParameter(
const std::string& calibratorID,
const std::string& param) {
146 Calibrator::setParameter(
const std::string& calibratorID,
const std::string& key,
const std::string& value) {
152 Calibrator::setFlow(
const std::string& calibratorID,
double begin,
double end,
double vehsPerHour,
double speed,
const std::string& typeID,
153 const std::string& routeID,
154 const std::string& departLane,
155 const std::string& departSpeed) {
158 vehicleParams.
vtypeid = typeID;
159 vehicleParams.
routeid = routeID;
162 throw TraCIException(
"Vehicle type '" + typeID +
"' is not known");
180 auto it = dict.find(
id);
181 if (it == dict.end()) {
196 std::shared_ptr<VariableWrapper>
208 return wrapper->
wrapInt(objID, variable, getIDCount());
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
C++ TraCI client API implementation.
Calibrates the flow on a segment to a specified one.
static const std::map< std::string, MSCalibrator * > & getInstances()
return all calibrator instances
const MSLane * getLane() const
virtual int passed() const
void setFlow(SUMOTime begin, SUMOTime end, double vehsPerHour, double speed, SUMOVehicleParameter vehicleParameter)
const MSRouteProbe * getRouteProbe() const
AspiredState getCurrentStateInterval() const
const MSEdge * getEdge() const
const std::set< std::string > & getVehicleTypes() const
Representation of a lane in the micro simulation.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Writes routes of vehicles passing a certain edge.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
The car-following model and parameter.
const std::string & getID() const
Returns the id.
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
Structure representing possible vehicle parameter.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
double departSpeed
(optional) The initial speed of the vehicle
std::string vtypeid
The vehicle's type id.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
std::string routeid
The vehicle's route id.
static int getPassed(const std::string &calibratorID)
static MSCalibrator * getCalibrator(const std::string &id)
static double getSpeed(const std::string &calibratorID)
static int getRemoved(const std::string &calibratorID)
static MSCalibrator::AspiredState getCalibratorState(const MSCalibrator *c)
static std::string getRouteID(const std::string &calibratorID)
static double getEnd(const std::string &calibratorID)
static std::string getEdgeID(const std::string &calibratorID)
static double getVehsPerHour(const std::string &calibratorID)
static std::vector< std::string > getVTypes(const std::string &routeID)
static std::string getRouteProbeID(const std::string &calibratorID)
static SubscriptionResults mySubscriptionResults
static std::string getTypeID(const std::string &calibratorID)
static double getBegin(const std::string &calibratorID)
static std::string getLaneID(const std::string &calibratorID)
static std::shared_ptr< VariableWrapper > makeWrapper()
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setFlow(const std::string &calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string &typeID, const std::string &routeID, const std::string &departLane="first", const std::string &departSpeed="max")
static ContextSubscriptionResults myContextSubscriptionResults
static int getInserted(const std::string &calibratorID)
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
TRACI_CONST int VAR_VEHSPERHOUR
TRACI_CONST int VAR_BEGIN
TRACI_CONST int VAR_ROUTE_PROBE
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_REMOVED
TRACI_CONST int VAR_ROAD_ID
TRACI_CONST int VAR_VTYPES
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int VAR_SPEED
TRACI_CONST int VAR_INSERTED
TRACI_CONST int VAR_PASSED
TRACI_CONST int VAR_ROUTE_ID
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
SUMOVehicleParameter * vehicleParameter