JuliaPOMDP / FactoredValueMCTS.jl

Scalable MCTS for team scenarios
MIT License
15 stars 3 forks source link

Use LightGraphs.jl API to check whether undirected graph edge in the graph rather than collected edgelist #4

Open rejuvyesh opened 2 years ago

rejuvyesh commented 2 years ago

https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/blob/26f7aa6738cc60e2cf786d9443c94a56d3b5608c/src/fvmcts/action_coordination/maxplus.jl#L191-L207

Thanks @freemin7 for bringing this to our attention on slack.

rejuvyesh commented 2 years ago

The correct way it seems will be to check has_edge(adjmatgraph, Edge(i,n)) or has_edge(adjmatgraph, Edge(n,i)) and use the appropriate bwd_messages then:

for n in nbrs
  if has_edge(tree.coordination_stats.adjmatgraph, Edge(i,n))
    e = Edge(i, n)
  elseif has_edge(tree.coordination_stats.adjmatgraph, Edge(n,i))
    e = Edge(n, i)
  end
  q_values[i,:] += bwd_messages[findfirst(isequal(e), edgelist), :] 
end
freemin7 commented 2 years ago

So does that mean that the current implementation is somehow "wrong"?

rejuvyesh commented 2 years ago

I'll have to run some experiments and check if we even ever hit the else case in the current version.

Jackiemesser commented 1 year ago

Is there any updates on this?