Setting up filter-based graph framework in C#
I need a little push in the right direction.
I want to code a framework in C# that allows me to create graphs that process (mostly numerical) data. I've been looking for the right nomenclature, and for other projects with the same goal, but found no satisfactory results. I'm pretty sure code like this already exists, and I don't want to completely reinvent the wheel. Also, more experienced programmers will probably use techniques (templates, interfaces, ...) that I would love to learn by examining their code.
The framework should process data much like the DirectShow framework handles video. Some components pro开发者_StackOverflowduce data (eg. a file reader or a sensor), some components manipulate data (eg. add, average) and some components render data (eg. a file writer or a chart drawing control). The components/nodes are connected using edges/lines.
Nodes can have multiple inputs (sinks) and outputs (sources). The framework should encompass the base classes that allow filter graphs to be constructed. Applications using the framework must subclass to implement the actual source, transform and render components.
An example: a GPS device produces latitude and longitude values (2 output pins). A calculator transforms these values into cartesian coordinates. The next component takes two consecutive coordinates and calculates the distance.
I am looking for tips, references and example code that enables me code the framework. Thanks!
UPDATE: Pipes.NET looks promising.
UPDATE: Dataflow is a relevant term.
I suppose you could use QuickGraph for all your graph needs. If none of the built-in algorithms are of use, it's always possible to simply iterate over the tree and invoke whatever custom logic you want along the way.
精彩评论