public void AddEventsAndEdges(IEnumerable <EventEdge <AbstractEvent> > edges) { foreach (EventEdge <AbstractEvent> edge in edges) { EventGraph.AddVerticesAndEdge(edge); } }
/// <summary> /// Podrska za povezivanje blokova EB simulatora. /// </summary> /// <param name="first"></param> /// <param name="second"></param> /// <returns></returns> public EventEdge <EventBlock> ConnectBlocks(EventBlock first, EventBlock second) { EventEdge <EventBlock> newEdge = new EventEdge <EventBlock>(first, second); EventGraph.AddVerticesAndEdge(newEdge); foreach (EventBlock ev in new EventBlock[] { first, second }) { if (ev is IEventObservable <DataPairArgs> && !Observer.DataPairs.ContainsKey(ev)) { (ev as IEventObservable <DataPairArgs>).Attach(Observer.OnNotify); Observer.DataPairs.Add(ev, new List <Tuple <double, double> >()); } else if (ev is IEventObservable <DataValueArgs> && !Observer.DataValues.ContainsKey(ev)) { (ev as IEventObservable <DataValueArgs>).Attach(Observer.OnNotify); Observer.DataValues.Add(ev, new List <double>()); } } return(newEdge); }
public void AddEventAndEdge(EventEdge <AbstractEvent> edge) { EventGraph.AddVerticesAndEdge(edge); }