{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671516330737,"data":{"id":71712777,"title":"5.3.6.1电车算路参数设置","slug":"xf548s","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
float vehicleCharge
0:客车 1:货车 2:电动客车 3:电动货车 4:插电式混动客车 5:插电式混动货车
boolean com.autonavi.gbl.route.RouteService.control(RouteControlKeyVehicleType, "2");
com.autonavi.gbl.common.model.ElecInfoConfig
public class ElecInfoConfig {\n public short \tcostModelSwitch; /**< 代价模型的组合开关,取值(正式):\n\t\t\t\t\t\t\t\t\t\t- 0x1 speed cost\n\t\t\t\t\t\t\t\t\t\t- 0x2 curve cost\n\t\t\t\t\t\t\t\t\t\t- 0x4 slope cost\n\t\t\t\t\t\t\t\t\t\t- 0x8 aux cost\n\t\t\t\t\t\t\t\t\t\t- 0x10 trans cost\n\t\t\t\t\t\t\t\t\t\t- 0x20 ferry cost\n\t\t\t\t\t\t\t\t\t\t- 0x40 powertrainloss\n\t\t\t\t\t\t\t\t\t\t- 位开关,例如所有的 costmodel 都参考的话设置\n\t\t\t\t\t\t\t\t\t\t- 0x7F */\n public short \tcostUnit; /**< 能量单位 0:L 1:KWH 2:METER 3:SECOND 默认是1 [非必须] */\n public float vehicleCharge; \t\t/**< 当前电量浮点型,缺省为空,实际请求时以RouteOption中的电量为准 */ \n public int \tpowerflag; \t\t/**< 能耗配置开关:0x00000001表示eta是否加充电时间, 0x00000010表示路线上的充电站充电时间是否下发 */\n public int \tarrivingPercent; \t/**< 到达充电站最大充电百分比 */\n int \tleavingPercent; \t\t/**< 到达充电站最小电量百分比 */ \n\tArrayList< ElecCostList > \tcostList;/**< 权值相关内容,可以有多组 */\n ElecCustomization customization; /**< 自定义能耗模型 */\n}\n\npublic class ElecCostList {\n public int \tID; \t\t\t\t\t\t\t\t\t/**< 客户端上传的标识 id */\n public int \ttype; \t\t\t\t\t\t\t\t/**< 代表 cost 的不同类型目前的取值有:[必须值] 0:eco 1:ecoplus 2:reg */ \n public ArrayList< ElecSpeedCostList > \tspeedCost; /**< speed 相关的权值 可以重复传多组 */\n public ArrayList< PowertrainLoss > \tpowertrainLoss; /**< 能量消耗与动力总成消耗的对应表数组 */\n public ElecCommonParameter \ttrans; \t\t\t\t/**< 转向相关的权值 rans Up和trans down必须大于0,且m_vehicleMass相除的到的值必须在72.0到72000.0之间,开区间,却speed Access必须小于speed Decess的值*/ \n\tpublic ElecCommonParameter \tcurve;\t\t\t\t\t/**< 曲率相关的权值 curve Up和curve down必须大于0,且与vehicleMass相除得到的值必须在72.0到72000.0之间,开区间,且curve Access必须小于curve Decess的值*/\n public ElecCommonParameter \tslope;\t\t\t\t\t/**< 坡度相关的权值 slop Up和slop down必须大于0,且与vehicleMass相除得到的值必须在72.0到72000.0之间,开区间,且slop Up必须小于slop Down的值*/\n public float \tauxValue;\t\t\t\t\t\t\t/**< aux 附加能量消耗系数 */\n public float \tferryRate;\t\t\t\t\t\t\t/**< 轮渡相关能量消耗系数 */\n\n}\n\npublic class ElecSpeedCostList {\n public int \tspeed; /**< 速度值 */ \n public float \tcostValue; \t/**< 速度对应的消耗值 */\n}\n\npublic class PowertrainLoss {\n public float \tpowerdemand; /**< 所需能量 */ \n public float \tcostValue; \t/**< 能量对应的消耗值 */\n}\n\npublic class ElecCommonParameter \n{\n public float \taccess; /**< 速度/曲率,上升,引起的能量消耗系数 */ \n public float \tdecess; /**< 速度/曲率,下降,引起的能量消耗系数 */\n}\n\n/**< 充电效率曲线 */\npublic class ChargingSocCurve { \n public long soc;\t/**< 剩余电量。单位:kwh */ \n public long power;\t/**< 充电电压。单位:kw */\n}\n\n/**< 车辆充电参数 */\npublic class VehicleChargingParameter { \n public ArrayList<ChargingSocCurve> socCurve; /**< DC 充电站的充电效率曲线 */\n public long maxPowerDc; \t\t\t /**< 直流充电时,电池可支持的最大功率。单位kW。*/\n public long baseLoadPower; \t\t /**< 基础功率,AC/DC很多情况下实际充电功率需要减掉这个基础功率。单位kW。 */\n public long maxChargingPower400V; /**< 直流400v充电站充电时,电池可支持的最大功率。单位kW。*/\n public long maxBatteryVoltage; \t /**< 直流充电时,电池可支持的最大电压。单位V。*/\n public long maxBatteryAmpere; \t /**< 直流充电时,电池可支持的最大电流。单位A。*/\n public long chargingTimeOffset; \t /**< 充电操作时间,在客户端上是可设置的配置项。单位秒。*/\n}\n\n\n/**< 耗电模型 */\npublic class ConsumptionArguments { \n public String id; /**< 模型id */\n public VehicleChargingParameter chargingVehicleParam; /**< 车辆参数 */\n}\n\n/**< 充电模型 */\npublic class ChargingArguments { \n public String id;\t\t\t\t\t\t\t\t /**< 模型id */ \n public VehicleChargingParameter chargingVehicleParam; /**< 车辆参数 */\n}\n\n/**< 充电接口参数 */\npublic class ChargerPlug { \n public long type; \t\t /**< 0.无效值 1.GBT-2011 2.GBT-2015 */ \n public long maximumPower; /**< 充电接口最大功率。单位wh */\n}\n\n/**< 充电接口类型 */\npublic class ChargerPlugsInfo { \n public ArrayList<ChargerPlug> suggestedPlugs; /**< 建议的充电接口 */ \n public ArrayList<ChargerPlug> supportedPlugs; /**< 支持的充电接口 */\n}\n\npublic class ElecCustomization { \n public ConsumptionArguments consumptionArg; /**< 耗电模型 */ \n public ChargingArguments chargingArg; /**< 充电模型 */ \n public ChargerPlugsInfo plugsInfo; /**< 充电接口参数 */\n public ArrayList<String> blackList; /**< 品牌黑名单 */\n}\n
boolean com.autonavi.gbl.route.RouteService.control(@RouteControlKey.RouteControlKey1 int key, String Value)
void com.autonavi.gbl.route.RouteService.setElecInfoConfig(ElecInfoConfig elecConfig)
long com.autonavi.gbl.route.RouteService.requestRoute(RouteOption routeOption)
void com.autonavi.gbl.common.path.option.RouteOption.setVehicleCharge(float vehicleCharge)
RouteOption详细参数见【基础算路】
说明:函数详情,请复制函数名称到在线API搜索
注意以下代价模型为示例数据,正式开发中请使用实车的代价模型。
RouteService mRouteService = (RouteService)ServiceMgr.getServiceMgrInstance().getBLService(SingleServiceID.RouteSingleServiceID);\n...\nRouteOption routeOption = RouteOption.create();\n...\nPOIForRequest poiForRequest = POIForRequest.create();\n...\nrouteOption.setPOIForRequest(poiForRequest);\n...\nint constrainCode = 0;\nconstrainCode |= 0x00004000\nrouteOption.setConstrainCode(constrainCode)\n...\n//设置当前电量\nrouteOption.setVehicleCharge(6.56f);\n//设置车辆类型为电动车\nmRouteService.control(RouteControlKeyVehicleType, "2");\n//设置电动车能耗参数\nElecInfoConfig elecConfig = new ElecInfoConfig();\nelecConfig.orgaName = "jaguar";\n/**< 引擎类型: [非必须]\n- 0:BMW_KONV_OTTO,\n- 1:BMW_KONV_DIESEL,\n- 2:BMW_BEV_REX,\n- 3:BMW_HEV_OTTO,\n- 4:BMW_HEV_DIESEL,\n- 5:BMW_PHEV_OTTO,\n- 6:BMW_PHEV_DIESEL,\n- 7:BMW_BEV_OHNE_REX */\nelecConfig.driveTrain = 6; //BMW_PHEV_DIESEL\n//驾驶模式取值(整数) [非必须]:\n//0:COMFORT 舒适模式\n//1:SPORT 运动模式\n//2:SPORTPLUS 运动plus模式\n//3:ECOPRO 节能模式\n//4:ECOPROPLUS 节能plus模式\nelecConfig.fesMode = 0; //设置驾驶模式为0:COMFORT 舒适模式\n//代价模型的组合开关取值(正式): [必须值]:\n//0x1 speed cost\n//0x2 curve cost\n//0x4 slope cost\n//0x8 aux cost\n//0x10 trans cost\n//0x20 ferry cost\n//0x40 powertrainloss\n//例如:代价模型只参考speed cost,则costmodel=0x1,同时参考speed、curve cost,则\n//costmodel=0x1|0x2,同时参考speed、curve、slope cost,则costmodel=0x1|0x2|0x4,\n//以此类推,所有的 costmodel 都参考的话设置0x7F,注意一旦设置了costmodel某个位,则\n//该位对应参数必须有效,有效值定义见下方各参数取值范围说明。\nelecConfig.costModelSwitch = 0x7F;//表示参考所有代价模型参数\n//能量单位\n//0,L\n//1,KWH\n//2,METER \n//3,SECOND\n//默认是1\nelecConfig.costUnit = 1;//KWH\nelecConfig.topSpeed = 150;\nelecConfig.vehiclelMass = 1440;\nelecConfig.maxVechicleCharge = 10.0f;\n\n//开启接续算路时需填写以下参数\nelecConfig.powerflag = 0x00000003;//eta包含充电时间+下发充电站充电时间\n// 注意arrivingPercent和leavingPercent字面含义和真实作用相反,请勿填反\nelecConfig.arrivingPercent = 80;\nelecConfig.leavingPercent = 20;\n\nElecCostList costList;\ncostList.ID = 0;//非必须值\n//代表 cost 的不同类型目前的取值有:[必须值] 0:eco 1:ecoplus 2:reg\ncostList.type = 1;\n\n//数组,设置电动车匀速行驶下的平均能耗\n//speed需单调递增,不能重复\n//至少需要2组以上参数\nElecSpeedCostList costItem = new ElecSpeedCostList();\ncostItem.speed = 7;\ncostItem.costValue = 23.0f;\nElecSpeedCostList costItem2 = new ElecSpeedCostList();\ncostItem2.speed = 120;\ncostItem2.costValue = 92.5f;\ncostList.speedCost.add(costItem);\ncostList.speedCost.add(costItem2);\n\n//数组,设置能量消耗与动力系统衰减因子\nPowertrainLoss l_powertrainLoss1 = new PowertrainLoss();\nl_powertrainLoss1.powerdemand = 7;\nl_powertrainLoss1.costValue = 23.5f;\n\nPowertrainLoss l_powertrainLoss2 = new PowertrainLoss();\nl_powertrainLoss2.powerdemand = 15;\nl_powertrainLoss2.costValue = 30;\n\ncostList.powertrainLoss.add(l_powertrainLoss1);\ncostList.powertrainLoss.add(l_powertrainLoss2);\n\n//设置加速时电能转化为动能的比例\n//速度上升的能量消耗系数,速度上升导致的动能提升与车辆耗电量间的比例关系,动能增量/TRANS_ACCESS=耗电量,单位J/KWH,取值范围[0-3600000]\n//access和dccess必须大于0\n//与vehicleMass相除的值必须在72.0到72000.0之间,开区间\n//access必须小于decess\ncostList.trans.access = 1200000;\ncostList.trans.decess = 2400000;\n\n//设置曲率相关\n//弯道速度上升导致的消耗系数,解释同速度上升的能量消耗系数\n//access和decess必须大于0\n//与vehicleMass相除的值必须在72.0到72000.0之间,开区间\n//access必须小于decess\ncostList.curve.access = 1200000;\ncostList.curve.decess = 2400000;\n\n//设置坡度上升额外的电能消耗\n//坡度上升的消耗系数,坡度上升导致的势能提升与车辆耗电量间的比例关系,势能增量/SLOPE_UP=耗电量,单位J/KWH,取值范围[0-3600000]\n//若\n//access和decess必须大于0\n//与vehicleMass相除的值必须在72.0到72000.0之间,开区间\n//access必须小于decess\ncostList.slope.access = 1200000;\ncostList.slope.decess = 2400000;\n\ncostList.auxValue = 0.5f;\ncostList.ferryRate = 0.8f;\nelecConfig.costList = new ArrayList< ElecCostList >();\nelecConfig.costList.add(costList);\n\n// 自定义能耗模型\n// 车辆充电参数\nChargingSocCurve consumptionCurveNode1;\nconsumptionCurveNode1.soc = 100;\nconsumptionCurveNode1.power = 100;\nChargingSocCurve consumptionCurveNode2;\nconsumptionCurveNode2.soc = 200;\nconsumptionCurveNode2.power = 200;\nelecConfig.customization.consumptionArg.chargingVehicleParam.socCurve.add(consumptionCurveNode1);\nelecConfig.customization.consumptionArg.chargingVehicleParam.socCurve.add(consumptionCurveNode2);\nelecConfig.customization.consumptionArg.chargingVehicleParam.maxPowerDc = 2;\nelecConfig.customization.consumptionArg.chargingVehicleParam.baseLoadPower = 2;\nelecConfig.customization.consumptionArg.chargingVehicleParam.maxChargingPower400V = 2;\nelecConfig.customization.consumptionArg.chargingVehicleParam.maxBatteryVoltage = 220;\nelecConfig.customization.consumptionArg.chargingVehicleParam.maxBatteryAmpere = 3;\nelecConfig.customization.consumptionArg.chargingVehicleParam.chargingTimeOffset = 60;\n// 车辆耗电参数\nChargingSocCurve chargingCurveNode1;\nchargingCurveNode1.soc = 100;\nchargingCurveNode1.power = 100;\nChargingSocCurve chargingCurveNode2;\nchargingCurveNode2.soc = 200;\nchargingCurveNode2.power = 200;\nelecConfig.customization.chargingArg.chargingVehicleParam.socCurve.add(chargingCurveNode1);\nelecConfig.customization.chargingArg.chargingVehicleParam.socCurve.add(chargingCurveNode2);\nelecConfig.customization.chargingArg.chargingVehicleParam.maxPowerDc = 3;\nelecConfig.customization.chargingArg.chargingVehicleParam.baseLoadPower = 3;\nelecConfig.customization.chargingArg.chargingVehicleParam.maxChargingPower400V = 2;\nelecConfig.customization.chargingArg.chargingVehicleParam.maxBatteryVoltage = 220;\nelecConfig.customization.chargingArg.chargingVehicleParam.maxBatteryAmpere = 2;\nelecConfig.customization.chargingArg.chargingVehicleParam.chargingTimeOffset = 60;\n//充电接口参数\n//建议的充电接口\nChargerPlug plug1;\nplug1.type = 1;\nplug1.maximumPower = 10 * 1000;\nelecConfig.customization.plugsInfo.suggestedPlugs.add(plug1);\nChargerPlug plug2;\nplug2.type = 1;\nplug2.maximumPower = 12 * 1000;\nelecConfig.customization.plugsInfo.suggestedPlugs.add(plug2);\n//支持的充电接口\nChargerPlug plug3;\nplug3.type = 1;\nplug3.maximumPower = 30 * 1000;\nelecConfig.customization.plugsInfo.supportedPlugs.add(plug3);\nChargerPlug plug4;\nplug4.type = 1;\nplug4.maximumPower = 40 * 1000;\nelecConfig.customization.plugsInfo.supportedPlugs.add(plug4);\n//充电站品牌黑名单\nelecConfig.customization.blackList.add("品牌名1");\nelecConfig.customization.blackList.add("品牌名2");\nelecConfig.customization.blackList.add("品牌名3");\nelecConfig.customization.blackList.add("品牌名4");\n\nmRouteService.setElecInfoConfig(elecConfig);\nmRouteService.requestRoute(routeOption);