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

相关内容

热门资讯

透视实锤!aapoker怎么设... 透视实锤!aapoker怎么设置抽水(透视)ai插件(竟然有挂)运aapoker怎么设置抽水辅助工具...
透视安装!aa poker辅助... 透视安装!aa poker辅助(透视)透视脚本(本来真的有挂);1、aa poker辅助透视辅助简单...
透视有挂!aapoker免费透... 透视有挂!aapoker免费透视脚本(透视)透视脚本下载(好像是有挂);1、实时aapoker免费透...
透视好友!aapoker辅助怎... 透视好友!aapoker辅助怎么用(透视)真的假的(总是有挂)1、aapoker辅助怎么用系统规律教...
透视有挂!aapoker辅助插... 透视有挂!aapoker辅助插件工具(透视)辅助(切实是真的有挂);aapoker辅助插件工具软件透...
透视透视!aapoker免费透... 透视透视!aapoker免费透视脚本(透视)透视脚本(一直有挂);在进入aapoker免费透视脚本辅...
透视最新!aapoker辅助工... 透视最新!aapoker辅助工具安全吗(透视)真的假的(一贯真的是有挂);aapoker辅助工具安全...
透视挂!aapoker插件下载... 透视挂!aapoker插件下载(透视)脚本(好像存在有挂)1、下载好aapoker插件下载辅助软件之...
透视软件!aapoker真的假... 透视软件!aapoker真的假的(透视)真的假的(其实有挂)在进入aapoker真的假的辅助挂后,参...
透视教学!aapoker俱乐部... 透视教学!aapoker俱乐部靠谱吗(透视)ai插件(其实真的是有挂)1、首先打开aapoker俱乐...