Scala 使用PathTill方法
我对Scala图有以下定义:Scala 使用PathTill方法,scala,graph,Scala,Graph,我对Scala图有以下定义: trait NodeType case class SourceNode() extends NodeType case class SinkNode() extends NodeType case class SimpleNode() extends NodeType case class Node(className: String, method: String, stmt: String, line: Int, nodeType: NodeType)
trait NodeType
case class SourceNode() extends NodeType
case class SinkNode() extends NodeType
case class SimpleNode() extends NodeType
case class Node(className: String, method: String, stmt: String, line: Int, nodeType: NodeType)
var svg = collection.mutable.Graph.empty[Node,DiEdge]
在svg图形的节点中调用pathUntil
方法时,使用sbt会出现以下编译错误:
value pathUntil is not a member of scalax.collection.mutable.Graph[br.unb.cic.soot.graph.Node,scalax.collection.GraphEdge.DiEdge]#NodeT
当我尝试使用方法
pathTo
时,也会发生类似的错误。奇怪的是,我的IDE的自动完成程序找到了这个路径直到操作。我想知道:scala编译器是否可能没有正确地推断节点图的类型?我应该导入一个特定的库还是设置任何编译器选项来解决这个问题?空的case类应该是case对象。除此之外,标准库没有Graph
类,因此提及您正在使用的库以及指向它的链接可能会很有用。哦。。。谢谢我在演示中使用scala graph(),使用了pathUntil
。也许可以尝试从那里导入,例如:import scalax.collection.edge.Implicits.\u
空的case类应该是case对象。除此之外,标准库没有Graph
类,因此提及您正在使用的库以及指向它的链接可能会很有用。哦。。。谢谢我在演示中使用scala graph(),使用了pathUntil
。也许可以尝试从那里导入,例如:import scalax.collection.edge.Implicits.\u