internal RelativePosition GetRelativePosition(ParallelAlgorithm pa) { RelativePosition res; if(!this.relativePositions.TryGetValue(pa, out res)) { return null; } return res; }
public void AddEdge(ParallelAlgorithm pa1, ParallelAlgorithm pa2) { this.AddEdge(new Edge(pa1, pa2)); }
internal void AddInitArguments(ParallelAlgorithm pa, string[] initializationArguments) { this.initArgs.Add(pa, initializationArguments); }
internal void AddRelativePosition(ParallelAlgorithm pa, RelativePosition rp) { this.relativePositions.Add(pa, rp); }
public VectorMessage(ParallelAlgorithm sender, ParallelAlgorithm receiver, double[] data) : base(sender,receiver) { this.data = data; }
public void AddParallelAlgorithm(ParallelAlgorithm pa) { pa.Simulator = this; pa.Id = this.algorithms.Count; this.algorithms.Add(pa); foreach(Edge e in pa.Edges) { this.edges.Add(e); } }
protected Message(ParallelAlgorithm sender, ParallelAlgorithm receiver) { this.sender = sender; this.receiver = receiver; }
public Edge(ParallelAlgorithm node1, ParallelAlgorithm node2) { this.node1 = node1; this.node2 = node2; }
public ParallelAlgorithm Other(ParallelAlgorithm node) { if(node == this.Node1) { return this.Node2; } else { return this.Node1; } }
public bool IsNode(ParallelAlgorithm node) { return (this.Node1 == node || this.Node2 == node); }
public TextMessage(ParallelAlgorithm sender, ParallelAlgorithm receiver, string message) : base(sender, receiver) { this.message = message; }