bool LaneArea::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { switch (variable) { case ID_LIST: return wrapper->wrapStringList(objID, variable, getIDList()); case ID_COUNT: return wrapper->wrapInt(objID, variable, getIDCount()); case LAST_STEP_VEHICLE_NUMBER: return wrapper->wrapInt(objID, variable, getLastStepVehicleNumber(objID)); case LAST_STEP_MEAN_SPEED: return wrapper->wrapDouble(objID, variable, getLastStepMeanSpeed(objID)); case LAST_STEP_VEHICLE_ID_LIST: return wrapper->wrapStringList(objID, variable, getLastStepVehicleIDs(objID)); case LAST_STEP_VEHICLE_HALTING_NUMBER: return wrapper->wrapInt(objID, variable, getLastStepHaltingNumber(objID)); case JAM_LENGTH_VEHICLE: return wrapper->wrapInt(objID, variable, getJamLengthVehicle(objID)); case JAM_LENGTH_METERS: return wrapper->wrapDouble(objID, variable, getJamLengthMeters(objID)); case LAST_STEP_OCCUPANCY: return wrapper->wrapDouble(objID, variable, getLastStepOccupancy(objID)); case VAR_POSITION: return wrapper->wrapDouble(objID, variable, getPosition(objID)); case VAR_LANE_ID: return wrapper->wrapString(objID, variable, getLaneID(objID)); case VAR_LENGTH: return wrapper->wrapDouble(objID, variable, getLength(objID)); default: return false; } }
bool TrafficLight::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { switch (variable) { case TRACI_ID_LIST: return wrapper->wrapStringList(objID, variable, getIDList()); case ID_COUNT: return wrapper->wrapInt(objID, variable, getIDCount()); case TL_RED_YELLOW_GREEN_STATE: return wrapper->wrapString(objID, variable, getRedYellowGreenState(objID)); case TL_CONTROLLED_LANES: return wrapper->wrapStringList(objID, variable, getControlledLanes(objID)); case TL_CURRENT_PHASE: return wrapper->wrapInt(objID, variable, getPhase(objID)); case VAR_NAME: return wrapper->wrapString(objID, variable, getPhaseName(objID)); case TL_CURRENT_PROGRAM: return wrapper->wrapString(objID, variable, getProgram(objID)); case TL_PHASE_DURATION: return wrapper->wrapDouble(objID, variable, getPhaseDuration(objID)); case TL_NEXT_SWITCH: return wrapper->wrapDouble(objID, variable, getNextSwitch(objID)); case TL_CONTROLLED_JUNCTIONS: return wrapper->wrapStringList(objID, variable, getControlledJunctions(objID)); default: return false; } }
bool VehicleType::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { switch (variable) { case TRACI_ID_LIST: return wrapper->wrapStringList(objID, variable, getIDList()); case ID_COUNT: return wrapper->wrapInt(objID, variable, getIDCount()); case VAR_LENGTH: return wrapper->wrapDouble(objID, variable, getLength(objID)); case VAR_HEIGHT: return wrapper->wrapDouble(objID, variable, getHeight(objID)); case VAR_MINGAP: return wrapper->wrapDouble(objID, variable, getMinGap(objID)); case VAR_MAXSPEED: return wrapper->wrapDouble(objID, variable, getMaxSpeed(objID)); case VAR_ACCEL: return wrapper->wrapDouble(objID, variable, getAccel(objID)); case VAR_DECEL: return wrapper->wrapDouble(objID, variable, getDecel(objID)); case VAR_EMERGENCY_DECEL: return wrapper->wrapDouble(objID, variable, getEmergencyDecel(objID)); case VAR_APPARENT_DECEL: return wrapper->wrapDouble(objID, variable, getApparentDecel(objID)); case VAR_ACTIONSTEPLENGTH: return wrapper->wrapDouble(objID, variable, getActionStepLength(objID)); case VAR_IMPERFECTION: return wrapper->wrapDouble(objID, variable, getImperfection(objID)); case VAR_TAU: return wrapper->wrapDouble(objID, variable, getTau(objID)); case VAR_SPEED_FACTOR: return wrapper->wrapDouble(objID, variable, getSpeedFactor(objID)); case VAR_SPEED_DEVIATION: return wrapper->wrapDouble(objID, variable, getSpeedDeviation(objID)); case VAR_VEHICLECLASS: return wrapper->wrapString(objID, variable, getVehicleClass(objID)); case VAR_EMISSIONCLASS: return wrapper->wrapString(objID, variable, getEmissionClass(objID)); case VAR_SHAPECLASS: return wrapper->wrapString(objID, variable, getShapeClass(objID)); case VAR_WIDTH: return wrapper->wrapDouble(objID, variable, getWidth(objID)); case VAR_COLOR: return wrapper->wrapColor(objID, variable, getColor(objID)); case VAR_MINGAP_LAT: return wrapper->wrapDouble(objID, variable, getMinGapLat(objID)); case VAR_MAXSPEED_LAT: return wrapper->wrapDouble(objID, variable, getMaxSpeedLat(objID)); case VAR_LATALIGNMENT: return wrapper->wrapString(objID, variable, getLateralAlignment(objID)); case VAR_PERSON_CAPACITY: return wrapper->wrapInt(objID, variable, getPersonCapacity(objID)); default: return false; } }
bool Person::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { switch (variable) { case TRACI_ID_LIST: return wrapper->wrapStringList(objID, variable, getIDList()); case ID_COUNT: return wrapper->wrapInt(objID, variable, getIDCount()); case VAR_POSITION: return wrapper->wrapPosition(objID, variable, getPosition(objID)); case VAR_POSITION3D: return wrapper->wrapPosition(objID, variable, getPosition(objID, true)); case VAR_ANGLE: return wrapper->wrapDouble(objID, variable, getAngle(objID)); case VAR_SLOPE: return wrapper->wrapDouble(objID, variable, getSlope(objID)); case VAR_SPEED: return wrapper->wrapDouble(objID, variable, getSpeed(objID)); case VAR_ROAD_ID: return wrapper->wrapString(objID, variable, getRoadID(objID)); case VAR_LANEPOSITION: return wrapper->wrapDouble(objID, variable, getLanePosition(objID)); case VAR_COLOR: return wrapper->wrapColor(objID, variable, getColor(objID)); case VAR_WAITING_TIME: return wrapper->wrapDouble(objID, variable, getWaitingTime(objID)); case VAR_TYPE: return wrapper->wrapString(objID, variable, getTypeID(objID)); case VAR_NEXT_EDGE: return wrapper->wrapString(objID, variable, getNextEdge(objID)); case VAR_STAGES_REMAINING: return wrapper->wrapInt(objID, variable, getRemainingStages(objID)); case VAR_VEHICLE: return wrapper->wrapString(objID, variable, getVehicle(objID)); default: return false; } }