AnyLogic道路库巷道选择问题
创始人
2024-08-22 15:30:16
0
  1. 创建道路图层和车道地图 在模型画布上,右键单击Roads并选择'Library”,在下拉菜单中选择'Custom”. 选中新建出的图层,然后在页面工具栏中选择'Create Object”来创建车道地图对象。

  2. 设置车道地图 您可以单击'Lanes”,然后在'Properties”窗口上的'Lane Setup”选项卡上设置车道数、车道宽度、车道长度和车道颜色。

  3. 将车辆行为赋予路口 选择交叉口,并在'Properties”窗口上的'Connections”选项卡中设置连接属性。设置'Lane Selection Algorithm”为'Simple”. 在'Number of Lanes”框中输入车道数。

  4. 编写车辆行为 在交通流(Traffic Flow)对象上单击右键并选择'Create Agent”, 然后选择'Vehicle”. 您可以定义车辆的速度和加速度。 在'Advanced”标签上, 设置'Speed Limit”为车道地图设定的最大速度。

示例代码: Intersection intersection = (Intersection)getFirstAgent(); RoadConnector inConnector = (RoadConnector)intersection.getInputConnector("In"); RoadConnector outConnector = (RoadConnector)intersection.getOutputConnector("Out"); Vehicle[] vehicles = inConnector.getEnteredVehicles(); for (Vehicle v : vehicles) { // Use a random number to pick a lane int laneIndex = (int) Math.floor(Math.random() * outConnector.getLanesCount()); Lane lane = outConnector.getLane(laneIndex); // Move the vehicle to the lane outConnector.moveVehicleToLane(v, lane); }

相关内容

热门资讯

透视透视挂!德普之星透视免费(... 透视透视挂!德普之星透视免费(透视)腾讯欢乐卡五星辅助器(好像有辅助神器)-哔哩哔哩所有人都在同一条...
据监测!德州局脚本(透视)微信... 据监测!德州局脚本(透视)微信小程序嘟嘟十三张脚本(切实真的有辅助辅助器)-哔哩哔哩1、超多福利:超...
事发当天!红龙poker作必弊... 事发当天!红龙poker作必弊指令(透视)微乐自建房怎么提高胜率(一直是真的辅助插件)-哔哩哔哩1、...
透视好友!sohoo poke... 透视好友!sohoo poker辅助器(透视)阿当比鸡有透视吗(确实真的是有辅助下载)-哔哩哔哩1、...
今天上午!pokernow辅助... 今天上午!pokernow辅助工具(透视)小唐家乐园辅助(本来是真的辅助app)-哔哩哔哩1、完成小...
透视脚本!wepoker辅助透... 透视脚本!wepoker辅助透视(透视)四川熊猫辅助软件(一直存在有辅助安装)-哔哩哔哩1、许多玩家...
据报道!wpk安卓下载辅助(透... 据报道!wpk安卓下载辅助(透视)酷玩联盟破解版下载(一直真的有辅助下载)-哔哩哔哩1、酷玩联盟破解...
透视真的!约局吧德州透视(透视... 透视真的!约局吧德州透视(透视)微信小程序财神十三张辅助(其实真的有辅助安装)-哔哩哔哩1、不需要A...
透视线上!we poker辅助... 透视线上!we poker辅助器下载(透视)开心泉州小程序有挂吗(一直是有辅助修改器)-哔哩哔哩1、...
据相关数据显示!wepoker... 据相关数据显示!wepoker透视脚本(透视)大唐开局自动外g挂(切实有辅助修改器)-哔哩哔哩1、大...