public Node(double chance, bool canDropValue, NodeListener listener)
        {
            if (chance < 0.0 || chance > 100.0)
            {
                throw new ArgumentException("Chance can't be lower than 0 or greater than 100");
            }

            if (listener == null)
            {
                throw new ArgumentException("Listener can't be null");
            }

            random       = new Random();
            ChanceValue  = chance;
            CanDropValue = canDropValue;
            nodeListener = listener;
        }
 public Generator(double chance, bool canDropValue, NodeListener listener) :
     base(chance, canDropValue, listener)
 {
 }
Exemple #3
0
 public MarkovChain()
 {
     Statistics = new WorkStatistics();
     Listener   = new NodeListener(Statistics);
 }
 protected BlockableNode(double chance, bool canDropValue, NodeListener listener) :
     base(chance, canDropValue, listener)
 {
 }
Exemple #5
0
 public HandlerNode(double chance, bool canDropValue, NodeListener listener) :
     base(chance, canDropValue, listener)
 {
 }
Exemple #6
0
 public QueueNode(bool canDropValue, int size, NodeListener listener) :
     base(1, canDropValue, listener)
 {
     Size = size;
 }