Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec _trace2 (sg : SectionGraph) (starting : Vertex) (section : Section)
- acc successp filterp stopp =
- match section.elements
- |> List.filter (fun el -> vEq el starting |> not)
- |> List.tryFind (fun el -> successp section el) with
- | Some (el) ->
- [((section, Some(el)) :: acc)]
- | None ->
- let outs =
- match acc with
- | (s,_) :: _ -> sg.outSectionsWrs (section, s)
- | _ -> sg.outSections (section)
- |> List.filter
- (fun (s : Section) ->
- not (s.have_element (fun a -> vEq a starting)))
- outs
- |> List.filter
- (fun (s : Section) ->
- filterp s
- && not(s.elements |> List.exists (fun e -> vEq e starting))
- && not(acc |> List.exists (fun (ex,_) -> ex.id = s.id)))
- |> List.collect
- (fun s ->
- _trace2 sg starting s ((section, None) :: acc)
- successp filterp stopp)
- member x.trace2 id successp filterp stopp =
- let start_v = x.vertices |> List.find (fun el -> el.Id.OriginalId = id)
- let sections =
- x.sections
- |> List.filter (fun s -> s.have_element (fun el -> vEq el start_v))
- |> List.filter
- (fun s ->
- let el = s.outermostElement start_v
- GraphExtensions.in_one_coursep start_v el)
- sections
- |> List.collect
- (fun s -> _trace2 x start_v s [] successp filterp stopp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement