Parameters for subrings.
상속: Parameters
예제 #1
0
        override public int Parse(string[] args)
        {
            if (base.Parse(args) < 0)
            {
                return(-1);
            }

            if (_subring_count > 0)
            {
                _subring = true;
            }

            SubringParameters prip = new SubringParameters(this);

            prip._size          = _subring_count;
            prip._pathing       = false;
            _private_parameters = prip;

            SubringParameters pubp = new SubringParameters(this);

            pubp._pathing      = true;
            pubp._dtls         = false;
            pubp._se           = false;
            pubp._ss           = false;
            _public_parameters = pubp;

            return(0);
        }
예제 #2
0
 public void CompleteTheSubring() {
   SubringParameters p = new SubringParameters();
   string[] args = "-b=.2 --dtls -c --secure_edges -s=25 --subring=10".Split(' ');
   Assert.AreNotEqual(-1, p.Parse(args), "Unable to parse" + p.ErrorMessage);;
   SubringSimulator sim = new SubringSimulator(p);
   Assert.IsTrue(sim.Complete(true), "Simulation failed to complete the ring");
 }
예제 #3
0
파일: Main.cs 프로젝트: bakriy/brunet
    public static int Main(string []args)
    {
#if SUBRING
      SubringParameters p = new SubringParameters();
#else
      Parameters p = new Parameters("Simulator", "Simulator - Brunet Time Based Simulator");
#endif
      if(p.Parse(args) != 0) {
        Console.WriteLine(p.ErrorMessage);
        p.ShowHelp();
        return -1;
      } else if(p.Help) {
        p.ShowHelp();
        return -1;
      }

#if SUBRING
      SubringSimulator sim = new SubringSimulator(p);
#else
      Simulator sim = new Simulator(p);
#endif

      if(p.Complete) {
        sim.Complete();
      } else if(p.Broadcast > -2) {
        Broadcast(sim, p.Broadcast);
      } else if(p.HeavyChurn > 0) {
        HeavyChurn(sim, p.HeavyChurn);
      } else if(p.Evaluation) {
        Evaluate(sim, p);
      } else {
        Commands(sim);
      }
      return 0;
    }
예제 #4
0
        public void CompleteTheSubring()
        {
            SubringParameters p = new SubringParameters();

            string[] args = "-b=.2 -c --secure_edges -s=25 --subring=10".Split(' ');
            Assert.AreNotEqual(-1, p.Parse(args), "Unable to parse" + p.ErrorMessage);
            SubringSimulator sim = new SubringSimulator(p);

            _sim = sim;
            Assert.IsTrue(sim.Complete(true), "Simulation failed to complete the ring");
        }
예제 #5
0
        public static int Main(string [] args)
        {
#if SUBRING
            SubringParameters p = new SubringParameters();
#else
            Parameters p = new Parameters("Simulator", "Simulator - Brunet Time Based Simulator");
#endif
            if (p.Parse(args) != 0)
            {
                Console.WriteLine(p.ErrorMessage);
                p.ShowHelp();
                return(-1);
            }
            else if (p.Help)
            {
                p.ShowHelp();
                return(-1);
            }

#if SUBRING
            SubringSimulator sim = new SubringSimulator(p);
#else
            Simulator sim = new Simulator(p);
#endif

            if (p.Complete)
            {
                sim.Complete(false);
            }
            else if (p.Broadcast > -2)
            {
                Broadcast(sim, p.Broadcast, p.Output);
            }
            else if (p.HeavyChurn > 0)
            {
                HeavyChurn(sim, p.HeavyChurn);
            }
            else if (p.Evaluation)
            {
                Evaluate(sim, p);
            }
            else
            {
                Commands(sim);
            }
            return(0);
        }
예제 #6
0
    override public int Parse(string[] args)
    {
      if(base.Parse(args) < 0) {
        return -1;
      }

      if(_subring_count > 0) {
        _subring = true;
      }

      SubringParameters prip = new SubringParameters(this);
      prip._size = _subring_count;
      prip._pathing = false;
      _private_parameters = prip;

      SubringParameters pubp = new SubringParameters(this);
      pubp._pathing = true;
      pubp._dtls = false;
      pubp._se = false;
      pubp._ss = false;
      _public_parameters = pubp;

      return 0;
    }
예제 #7
0
 public SubringParameters(SubringParameters parameters) : base(parameters)
 {
 }
예제 #8
0
 public SubringSimulator(SubringParameters sparams) :
     base(sparams.PrivateParameters, true)
 {
     _shared_overlay = new Simulator(sparams.PublicParameters);
     Start();
 }
예제 #9
0
 public SubringParameters(SubringParameters parameters) : base(parameters)
 {
 }