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); }

相关内容

热门资讯

透视挂!wpk透视脚本,hhp... 透视挂!wpk透视脚本,hhpoker免费辅助器,总结教程(有挂工具)1、wpk透视脚本透视辅助简单...
透视透视"aapok... 透视透视"aapoker真的假的"详细辅助安装教程(辅助透视技巧)1、许多玩家不知道aapoker真...
透视系统!智星德州菠萝插件官网... 透视系统!智星德州菠萝插件官网,wepoker的辅助器,教你攻略(有挂细节)该软件可以轻松地帮助玩家...
透视安装"hhpok... 这是一款非常优秀的hhpoker是正规的吗 ia辅助检测软件,能够让你了解到hhpoker是正规的吗...
透视了解!aapoker辅助挂... 透视了解!aapoker辅助挂,wepoker究竟有没有透视,线上教程(有挂脚本);1、aapoke...
透视有挂"epoke... 透视有挂"epoker底牌透视"详细辅助新版2025教程(辅助软件方法)1、很好的工具软件,可以解锁...
透视挂!hhpoker透视脚本... 透视挂!hhpoker透视脚本视频,wepoker数据分析工具,技巧教程(有挂黑科技)1、让任何用户...
透视神器"德州局怎么... 此外,数据分析德州(德州局怎么透视)辅助神器app还具备辅助透视行为开挂功能,通过对客户德州局怎么透...
透视挂!德普之星辅助功能如何设... 透视挂!德普之星辅助功能如何设置,德普之星辅助器,AI教程(有挂插件);1、下载好德普之星辅助功能如...
透视透视"wepok... 透视透视"wepoker有脚本吗"详细辅助爆料教程(辅助器下载软件)1、很好的工具软件,可以解锁游戏...