/* * This is the central method of the whole Dataflow engine as it executes the patches. * * A breath first search over the entire graph is done, starting from the rootSet. * All patches that have no connected inlets are part of the rootSet. * * The algorith is the follow * * 1) push all elements from the root set into the execution queue * * 2) dequeue a patch from the execution queue * 3) if execution criteria is met execute it *1 * 4) propagate the values of all changed outlets and add the receiving patches to the discovered set *2 *3 * 5) goto to step 2 if the execution queue is not empty * 6) move all elements from the discovered set to the execution queue * 7) goto step 2 if the execution queue is not empty * 8) finish the frame * * *1 right now the only criteria is 'execute allways' * *2 outlet values propagation and patch enqueuing are done from first to last outlet. * *3 order of discovery is maintained during execution. */ public void StepFrame() { LinkedList <IPatchContainer> executionQueue = new LinkedList <IPatchContainer> (); HashedLinkedList <IPatchContainer> discoveredSet = new HashedLinkedList <IPatchContainer> (); executionQueue.AddAll(this.rootSet); do { while (executionQueue.Count > 0) { IPatchContainer patch = executionQueue.RemoveFirst(); patch.ExecutePatch(); foreach (IOutlet outlet in patch.Outlets) { outlet.PropagateChanges(discoveredSet); } } if (discoveredSet.Count > 0) { executionQueue.AddAll(discoveredSet); discoveredSet.Clear(); } } while (executionQueue.Count > 0); }
public void Init(IPatchContainer container) { Args = container.AddInlet <string>("Arguments"); Path = container.AddInlet <string>("Path"); StdIn = container.AddInlet <string>("Input"); StdOut = container.AddOutlet <string>("Output"); StdErr = container.AddOutlet <string>("Error"); Status = container.AddOutlet <int>("Status"); }
public void Init(IPatchContainer container) { left = container.AddInlet <int> ("left"); right = container.AddInlet <int> ("right"); result = container.AddOutlet <int> ("result"); }
public void Init(IPatchContainer container) { passive = container.AddPassiveInlet <int>("passive"); active = container.AddInlet <int>("active"); onchange = container.AddActivateOnChangeInlet <int>("onchange"); }
public void Init(IPatchContainer container) { res = container.AddOutlet <int>("value"); }
public void Init(IPatchContainer container) { input = container.AddInlet <int>("inlet"); }
public void SetUp() { mocks = new Mockery(); mockPatchContainer = mocks.NewMock <IPatchContainer>(); Stub.On(mockPatchContainer).GetProperty("CurrentFrame").Will(Return.Value(0)); }
public void Init(IPatchContainer container) { left = container.AddInlet<int> ("left"); right = container.AddInlet<int> ("right"); result = container.AddOutlet<int> ("result"); }
public Outlet(string name, IPatchContainer patch) { this.name = name; this.patch = patch; }
public void Init(IPatchContainer container) { input = container.AddInlet <int>("Number"); output = container.AddOutlet <int>("Number"); }
public void Init(IPatchContainer container) { output = container.AddOutlet<int>("OutPut"); }
public void Init(IPatchContainer container) { input = container.AddInlet<int>("InPort"); }
public void Init(IPatchContainer container) { Args = container.AddInlet<string>("Arguments"); Path = container.AddInlet<string>("Path"); StdIn = container.AddInlet<string>("Input"); StdOut = container.AddOutlet<string>("Output"); StdErr = container.AddOutlet<string>("Error"); Status = container.AddOutlet<int>("Status"); }
public void Init(IPatchContainer container) { }
public void Init(IPatchContainer container) { output = container.AddOutlet <int>("OutPut"); }
public void Init(IPatchContainer container) { input = container.AddInlet<int>("Number"); output = container.AddOutlet<int>("Number"); }
public void SetUp() { mocks = new Mockery(); mockPatchContainer = mocks.NewMock<IPatchContainer>(); Stub.On(mockPatchContainer).GetProperty("CurrentFrame").Will(Return.Value(0)); }
//EqualityComparer<T> comparer;// = EqualityComparer<T>.Default; public Inlet(string name, IPatchContainer patch, ActivationMode mode) { this.name = name; this.patch = patch; this.mode = mode; }