是否可以从ArangoDB / Foxx服务中的Traverser步骤中获取结果?
我正在寻求在电网图上实施欧姆电阻计算。 在这里,我沿着图形的边缘向BFS(广度优先)遍历它的叶子。 - 没问题。 使用过滤器,扩展器和访客就可以了!
我感兴趣的是对分支节点/步骤中的每一行执行1/x
计算,以便在回到图表的“返回根/顶部”时解决并联阻力。
所以,我的问题是: “是否有可能从每一步获得回报价值?” - 如果是,我可以在哪里指定计算返回值?
感谢任何提示!
更新2017-12-21:进一步说明
以下是我案例演示图的图像:Image of the Demo Graph 图像说明: *“黑色”值是计算的原始欧姆值(例如,加权图中边缘的权重)。 *“红色”值是每个步骤的欧姆值(子结果)。
图表的CSV数据:
"_key","stationId","voltage","voltageKey","pathId","elementId","type","typeKey","name","status","oStatus","isSource","sourceColor","isStrandSource","isStrandEnd","strandSourceColor" "NE-2_J_1","2","20","J","","1","conn","","root","1","1","","","","","" "NE-2_J_2","2","20","J","","2","conn","","Abzweig 1","1","1","","","","","" "NE-2_J_3","2","20","J","","3","conn","","Abzweig 2","1","1","","","","","" "NE-2_J_4","2","20","J","","4","conn","","Abzweig 3","1","1","","","","","" "NE-2_J_5","2","21","J","","5","conn","","Abzweig 4","1","1","","","","","" "NE-2_J_6","2","22","J","","6","conn","","Abzweig 5","1","1","","","","","" "NE-2_J_7","2","23","J","","7","conn","","Abzweig 6","1","1","","","","","" "NE-2_J_8","2","24","J","","8","conn","","Abzweig 7","1","1","","","","",""
"_key","_from","_to","elementId","type","typeKey","voltage","voltageKey","name", "status","oStatus","xOhm" "NE-J19","NE-2_J_1","NE-2_J_2","19","solid","","20","J","","1","1","1" "NE-J20","NE-2_J_2","NE-2_J_3","20","solid","","20","J","","1","1","2" "NE-J21","NE-2_J_2","NE-2_J_4","21","solid","","20","J","","1","1","3" "NE-J22","NE-2_J_3","NE-2_J_5","22","solid","","20","J","","1","1","4" "NE-J23","NE-2_J_3","NE-2_J_6","23","solid","","20","J","","1","1","5" "NE-J24","NE-2_J_4","NE-2_J_7","24","solid","","20","J","","1","1","6" "NE-J25","NE-2_J_4","NE-2_J_8","25","solid","","20","J","","1","1","7"
计算说明:
计算是“自下而上”执行的,所以我的目的是在遍历器“返回”基础图的结果后处理数学。
步骤1:计算“NE-2_J_3”处“左下”分支(“NE-2_J_5”和“NE-2_J6”)产生的(并联)电阻:
1 / ( 1/4 Ohm + 1/5 Ohm ) = 2,22 Ohm
步骤2:计算“NE-2_J_4”处“右下”分支(“NE-2_J_7”和“NE-2_J_8”)产生的(并联)电阻:
1 / ( 1/6 Ohm + 1/7 Ohm ) = 3,23 Ohm
步骤3:在计算步骤5之前,计算“左下”分支的结果(内联)电阻(“NE-2_J_3 raw”值和“NE-2_J_3计算”):
2 Ohm + 2,22 Ohm = 4,22 Ohm
步骤4:在计算步骤5之前,计算“右下”分支的结果(内联)电阻(“NE-2_J_4 raw”值和“NE-2_J_4计算”):
3 Ohm + 3,23 Ohm = 6,23 Ohm
步骤5:在“NE-2_J_2”处计算“中心”分支(步骤3和步骤4)的结果(并行)电阻:
1 / ( 1/4,22 Ohm + 1/6,23 Ohm ) = 2,52 Ohm
步骤6:计算“中心”分支的结果(内联)电阻(“NE-2_J_2原始”值和“NE-2_J_2计算”)对于“NE-2_J_1”的最终结果:< / p>
1 Ohm + 2,52 Ohm = 3,52 Ohm