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