Example #1
0
 internal RelativePosition GetRelativePosition(ParallelAlgorithm pa)
 {
     RelativePosition res;
     if(!this.relativePositions.TryGetValue(pa, out res)) {
         return null;
     }
     return res;
 }
Example #2
0
 public void AddEdge(ParallelAlgorithm pa1, ParallelAlgorithm pa2)
 {
     this.AddEdge(new Edge(pa1, pa2));
 }
Example #3
0
 internal void AddInitArguments(ParallelAlgorithm pa, string[] initializationArguments)
 {
     this.initArgs.Add(pa, initializationArguments);
 }
Example #4
0
 internal void AddRelativePosition(ParallelAlgorithm pa, RelativePosition rp)
 {
     this.relativePositions.Add(pa, rp);
 }
Example #5
0
 public VectorMessage(ParallelAlgorithm sender, ParallelAlgorithm receiver, double[] data)
     : base(sender,receiver)
 {
     this.data = data;
 }
Example #6
0
 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);
     }
 }
Example #7
0
 protected Message(ParallelAlgorithm sender, ParallelAlgorithm receiver)
 {
     this.sender = sender;
     this.receiver = receiver;
 }
Example #8
0
 public Edge(ParallelAlgorithm node1, ParallelAlgorithm node2)
 {
     this.node1 = node1;
     this.node2 = node2;
 }
Example #9
0
 public ParallelAlgorithm Other(ParallelAlgorithm node)
 {
     if(node == this.Node1) {
         return this.Node2;
     }
     else {
         return this.Node1;
     }
 }
Example #10
0
 public bool IsNode(ParallelAlgorithm node)
 {
     return (this.Node1 == node || this.Node2 == node);
 }
Example #11
0
 public TextMessage(ParallelAlgorithm sender, ParallelAlgorithm receiver, string message)
     : base(sender, receiver)
 {
     this.message = message;
 }