Class Dag<T>
- Namespace
- Dec
- Assembly
- dec.dll
A simple stable Dag evaluation class, made public for utility usage.
public static class Dag<T>
Type Parameters
T
- Inheritance
-
objectDag<T>
Remarks
This isn't really part of Dec, it's just here for convenience because Dec needs it.
Methods
CalculateOrder<U>(IEnumerable<T>, List<Dependency>, Func<T, U>)
Given an input list and a list of dependencies, calculate a stable order.
public static List<T> CalculateOrder<U>(IEnumerable<T> input, List<Dag<T>.Dependency> dependencies, Func<T, U> tiebreaker) where U : IComparable<U>
Parameters
input
IEnumerable<T>dependencies
List<Dag<T>.Dependency>tiebreaker
Func<T, U>
Returns
- List<T>
Type Parameters
U
Remarks
This is guaranteed to return the same order every run.
Some effort is made to minimize output changes if more items are added or more dependencies are added.
Output may change after Dec is updated; this is not guaranteed stable between versions!