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