Brunet.Simulator.Simulator.Start C# (CSharp) Method

Start() protected method

protected Start ( ) : void
return void
    protected void Start()
    {
      _start = true;
      for(int i = 0; i < _parameters.Size; i++) {
        AddNode();
      }

      TransportAddress broken_ta = TransportAddressFactory.CreateInstance("b.s://" + 0);
      for(int idx = 0; idx < Nodes.Count; idx++) {
        NodeMapping nm = Nodes.Values[idx];
        var tas = new List<TransportAddress>();
        int cidx = idx + 1;
        cidx = cidx == Nodes.Count ? 0 : cidx;
        tas.Add(Nodes.Values[cidx].Node.LocalTAs[0]);
        if(_broken != 0) {
          tas.Add(broken_ta);
        }
        nm.Node.RemoteTAs = tas;
      }
      foreach(NodeMapping nm in Nodes.Values) {
        nm.Node.Connect();
      }
      _start = false;
    }