Contact Graph Routing for time-varying satellite networks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-cgr: enable MDX on lib/cgr.mli, fix broken doc example

Run mdx on lib/cgr.mli so the {[ ... ]} odoc block now type-checks.

Two issues:
- `Contact.v ~from:... ~to_:... ~start:... ~stop:... ~rate:...;`
was missing the trailing `()` argument (the signature ends with
`?owlt:float -> unit -> t`).
- The `let route = ...` binding shadowed the toplevel `route`
function, which works but obscures the call. Renamed to
`earth_to_mars` and added `assert (Option.is_some earth_to_mars)`
so the example documents that a route through the relay exists.

+13 -6
+9 -6
lib/cgr.mli
··· 23 23 {[ 24 24 open Cgr 25 25 26 - (* Define nodes *) 26 + (* Define nodes. *) 27 27 let earth = Node.v "EARTH" 28 28 let mars = Node.v "MARS" 29 29 let relay = Node.v "RELAY" 30 30 31 - (* Define contacts (start_time, end_time, rate in bytes/sec) *) 31 + (* Define contacts (start_time, end_time, rate in bytes/sec). *) 32 32 let contacts = 33 33 [ 34 - Contact.v ~from:earth ~to_:relay ~start:0. ~stop:100. ~rate:1_000_000.; 35 - Contact.v ~from:relay ~to_:mars ~start:50. ~stop:150. ~rate:500_000.; 34 + Contact.v ~from:earth ~to_:relay ~start:0. ~stop:100. 35 + ~rate:1_000_000. (); 36 + Contact.v ~from:relay ~to_:mars ~start:50. ~stop:150. 37 + ~rate:500_000. (); 36 38 ] 37 39 38 - (* Create contact plan and find route *) 40 + (* Create contact plan and find route. *) 39 41 let plan = Contact_plan.of_list contacts 40 - let route = route plan ~src:earth ~dst:mars ~time:0. 42 + let earth_to_mars = route plan ~src:earth ~dst:mars ~time:0. 43 + let () = assert (Option.is_some earth_to_mars) 41 44 ]} 42 45 43 46 {2 References}
+4
lib/dune
··· 2 2 (name cgr) 3 3 (public_name cgr) 4 4 (libraries bheap fmt)) 5 + 6 + (mdx 7 + (files cgr.mli) 8 + (libraries cgr))