Add a get_graph_attributes function to the sasa API

The idea is be able to transmit parameters to algo. For that we can take advantage of the graph attributes mechanism of dot.

For instance, one could write dot files that looks like:

 graph g {
  diameter=2
  k=42  

  p1 [algo=p.ml]
  p2 [algo=p.ml]
  p1 -- p2
}

And then access to k and to the diameter as follows:

 let (init_state: int -> 's) =
  fun _ -> 
    let diameter = int_of_string (get_graph_attributes "diameter") in
    let k = int_of_string (get_graph_attributes "k") in
    diameter+ (Random.int k)
Edited Jul 02, 2019 by erwan
Assignee Loading
Time tracking Loading