0
我是spark-graphx和scala中的新成员。 我写这个方法来验证目标顶点的分数是否已经改变。构造函数不能实例化为预期类型;发现:(T1,T2,T3,T4,T5)
def IsGoalVertexFound(graph: Graph[(VertexId,(Int,Float,Float,Float,String)),Float],goalVertex:(VertexId,(Int,Float,Float,Float))): Boolean ={
var IsgoalFound:Boolean=false
var targetVertex=graph.vertices.filter{ case (id,(_,gScore,_,_,_)) => id == goalVertex._1 && gScore!=Float.PositiveInfinity}
if(targetVertex.isEmpty())
IsgoalFound=true
return IsgoalFound
}
我得到这个错误:
Error:(41, 54) constructor cannot be instantiated to expected type;
found : (T1, T2, T3, T4, T5)
required: (org.apache.spark.graphx.VertexId, (Int, Float, Float, Float, String))
(which expands to) (Long, (Int, Float, Float, Float, String))
var targetVertex=graph.vertices.filter{ case (id,(_,gScore,_,_,_)) => id == goalVertex._1 && gScore!=Float.PositiveInfinity}
任何想法? 很多谢谢
谢谢你的答案... – imen