问题标签 [neighbours]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 检查二维数组中每个邻居的最快方法
我正在开发一个随机地牢生成器,只是为了好玩/作为学习一些新事物的辅助项目。我编写了一个函数,它为任何给定的单元格返回一个整数哈希值,它为您提供有关它应该是什么类型的游戏对象的信息。即如果它是一堵墙,面对什么方向,它是不是一个角落,等等。这是功能当前的样子。
我的问题是,是否有一种更有效、更快的方法来进行这些我可能没有想到的检查?地牢数组的大小范围从 100x100 到 1000x1000,尽管该函数不会在每个单元格上调用。我有一个单独的列表,其中包含房间,并且我迭代以实例化对象的每个方向都有开始和结束索引。
netlogo - Choosing patch analysing neighboors netlogo
I am trying to model an community that engages in shifting cultivation. For that I want each household to change the patch every year. Each household can have a different crop area, depending on time and number of people working. I want them to be able to choose a patch that has the amount of forest patch need to open their crop. For example, one household has a crop area of 3, so the new location needs to be a forest patch with two other forest patch neighbors. Any idea how can I specify that?
Thanks
python - Jaccard 相似度得分 ValueError: multiclass-multioutput is not supported Python
我想计算两个列表或一组单词的 jaccard 索引。我的价值观如下:
如果我计算jaccard_similarity_score(list1,list2)
我得到这个错误ValueError: multiclass-multioutput is not supported
。
我也尝试使用这样的集合:
但我得到这个错误ValueError: Expected array-like (array or non-string sequence), got set(['whispered', 'Golden', 'enjoyment', 'washed', 'wedged', 'Keep', 'mid-December', 'jittery', 'waking', 'Lying'])
我做错了什么?
python-2.7 - Python - Networkx:具有一定权重的邻居
本题设置为python 2.7,使用包networkx:https ://networkx.github.io/documentation/stable/reference/classes/generated/networkx.Graph.neighbors.html
我正在寻找一种使用函数“networkx.Graph.neighbors”的方法,它返回所有具有特定权重值(或高于/低于特定值)的邻居。
有什么建议可以让这成为可能吗?
提前致谢 :)。蒂姆
javascript - 在矩阵中寻找邻居并将其存储
我正在尝试使用 Javascript 检查数组的位置是否有邻居,然后存储它,但是我收到一个错误,我不明白为什么会发生。
有代码:
netlogo - Netlogo,将变量分配给邻居
我的代码有问题,我正在制作一个土地利用模型,我想在其中为有剩余的补丁提供新的土地利用。要确定补丁应该改变的土地用途是基于其邻居的吸引力。
拥有的补丁 = 土地使用意愿和吸引力
我想要什么:愿意改变的补丁,应该将他们的土地利用改变为具有最高吸引力的邻居的土地利用(越接近0越有吸引力)
我试图用以下语句来做到这一点:
然而,Netlogo 在运行时报告:“OF 预期输入是海龟代理集或补丁代理集或海龟或补丁,但得到了数字 0。”
任何人建议如何以它的工作方式对其进行编码?
我的整个代码:
networking - 通过 struct rt 检索邻居条目
我正在研究一个内核模块代码,我需要在其中查看路由表以获取我的 ARP 表条目daddr
:
例如,我需要获取neighbour
192.168.3.111 的条目,并且该条目已永久添加到表中:
我想出了以下代码:
但是neigh_ha_snapshot
不返回正确MAC
的地址,实际上我认为它返回垃圾,有时ff:ff:ff:ff:ff:ff
,有时是多播01:xx:xx:xx:xx:xx
。
我究竟做错了什么?
packet-sniffers - 如何在 Contiki 中偷听邻居 mote Tx/Rx?
我想知道在RPL网络中,一个节点将一个数据包发送到另一个节点(例如RPL-Collect/udp-sender)后,如何知道预期的节点是否会转发这个数据包?我认为需要偷听邻居传输,但在Contiki/Cooja中实现此场景的另一种简单方法是什么?